Skip to content

Cannot compile unittests #5

Open
@youngar

Description

@youngar

When running make unitttests there is a compilation failure:

make unittests
g++ -std=c++11 -m64 -Wno-endif-labels  -DDEBUG -O0 -g -DUNITTESTS -DGC_TYPE=GENERATIONAL -I/home/aryoung/wsp/SOMpp/src -fno-PIC -mcmodel=large -c /home/aryoung/wsp/SOMpp/src/unitTests/CloneObjectsTest.cpp -o /home/aryoung/wsp/SOMpp/src/unitTests/CloneObjectsTest.o
g++ -std=c++11 -m64 -Wno-endif-labels  -DDEBUG -O0 -g -DUNITTESTS -DGC_TYPE=GENERATIONAL -I/home/aryoung/wsp/SOMpp/src -fno-PIC -mcmodel=large -c /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.cpp -o /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.o
In file included from /usr/include/cppunit/portability/Stream.h:283:0,
                 from /usr/include/cppunit/TestAssert.h:7,
                 from /usr/include/cppunit/TestCase.h:6,
                 from /usr/include/cppunit/TestCaller.h:5,
                 from /usr/include/cppunit/extensions/HelperMacros.h:9,
                 from /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.h:27,
                 from /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.cpp:11:
/usr/include/c++/7.2.0/sstream:300:7: error: ‘struct std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’ redeclared with different access
       struct __xfer_bufptrs
       ^~~~~~
make: *** [/home/aryoung/wsp/SOMpp/build/Linux.make:76: /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.o] Error 1

I believe it is caused by the following macros definitions, which are used in the unit tests.

src/unitTests/CloneObjectsTest.cpp:10:#define private public
src/unitTests/WalkObjectsTest.cpp:10:#define private public
src/unitTests/WriteBarrierTest.cpp:6:#define private public

Using

Arch Linux 
Linux aryoung-tp 4.13.11-1-ARCH #1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017 x86_64 GNU/Linux

gcc (GCC) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions