Open ghost opened 4 years ago
Can you try adding -lpthread
to the compiler flags? That's what I found with 30 seconds of Googling.
Thank you!
Is this something that you could patch in a PR, so that it's fixed for other folks as well?
After adding SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
I am having the result like below
[3/70] Linking CXX executable lib/graph/SbGraphTest
FAILED: lib/graph/SbGraphTest
: && /usr/bin/c++ -Wall -Wextra -g -Werror=switch -std=c++11 -pthread -O3 -DRELEASE -rdynamic lib/graph/CMakeFiles/SbGraphTest.dir/tests/datum.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/graph.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/link.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/main.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/node.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/script.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/subgraph.cpp.o -o lib/graph/SbGraphTest lib/graph/libSbGraph.a -lboost_python3 /usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a && :
/usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a(dynload_shlib.o): In function _PyImport_FindSharedFuncptr': /opt/Python-3.8.1/./Python/dynload_shlib.c:86: undefined reference to
dlsym'
/opt/Python-3.8.1/./Python/dynload_shlib.c:99: undefined reference to dlopen' /opt/Python-3.8.1/./Python/dynload_shlib.c:130: undefined reference to
dlsym'
/opt/Python-3.8.1/./Python/dynload_shlib.c:99: undefined reference to dlopen' /opt/Python-3.8.1/./Python/dynload_shlib.c:105: undefined reference to
dlerror'
/usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a(posixmodule.o): In function os_openpty_impl': /opt/Python-3.8.1/./Modules/posixmodule.c:6586: undefined reference to
openpty'
/usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a(posixmodule.o): In function os_forkpty_impl': /opt/Python-3.8.1/./Modules/posixmodule.c:6684: undefined reference to
forkpty'
collect2: error: ld returned 1 exit status
[4/70] Linking CXX executable lib/fab/SbFabTest
FAILED: lib/fab/SbFabTest
: && /usr/bin/c++ -Wall -Wextra -g -Werror=switch -std=c++11 -pthread -O3 -DRELEASE -rdynamic lib/fab/CMakeFiles/SbFabTest.dir/tests/main.cpp.o lib/fab/CMakeFiles/SbFabTest.dir/tests/parser.cpp.o lib/fab/CMakeFiles/SbFabTest.dir/tests/shape.cpp.o -o lib/fab/SbFabTest lib/fab/libSbFab.a -lboost_python3 /usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a -lpng -lz && :
/usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a(dynload_shlib.o): In function _PyImport_FindSharedFuncptr': /opt/Python-3.8.1/./Python/dynload_shlib.c:86: undefined reference to
dlsym'
/opt/Python-3.8.1/./Python/dynload_shlib.c:99: undefined reference to dlopen' /opt/Python-3.8.1/./Python/dynload_shlib.c:130: undefined reference to
dlsym'
/opt/Python-3.8.1/./Python/dynload_shlib.c:99: undefined reference to dlopen' /opt/Python-3.8.1/./Python/dynload_shlib.c:105: undefined reference to
dlerror'
/usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a(posixmodule.o): In function os_openpty_impl': /opt/Python-3.8.1/./Modules/posixmodule.c:6586: undefined reference to
openpty'
/usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a(posixmodule.o): In function os_forkpty_impl': /opt/Python-3.8.1/./Modules/posixmodule.c:6684: undefined reference to
forkpty'
collect2: error: ld returned 1 exit status
[16/70] Building CXX object app/CMakeFiles/antimony.dir/graph/hooks/ui.cpp.o
ninja: build stopped: subcommand failed.
Problem while building the program on Ubuntu;p
[2/18] Linking CXX executable lib/fab/SbFabTest FAILED: lib/fab/SbFabTest : && /usr/bin/c++ -Wall -Wextra -g -Werror=switch -O3 -DRELEASE -rdynamic lib/fab/CMakeFiles/SbFabTest.dir/tests/main.cpp.o lib/fab/CMakeFiles/SbFabTest.dir/tests/parser.cpp.o lib/fab/CMakeFiles/SbFabTest.dir/tests/shape.cpp.o -o lib/fab/SbFabTest lib/fab/libSbFab.a -lboost_python3 /usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a -lpng -lz && : /usr/bin/ld: /usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a(thread.o): undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3' //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status [3/18] Linking CXX executable lib/graph/SbGraphTest FAILED: lib/graph/SbGraphTest : && /usr/bin/c++ -Wall -Wextra -g -Werror=switch -O3 -DRELEASE -rdynamic lib/graph/CMakeFiles/SbGraphTest.dir/tests/datum.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/graph.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/link.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/main.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/node.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/script.cpp.o lib/graph/CMakeFiles/SbGraphTest.dir/tests/subgraph.cpp.o -o lib/graph/SbGraphTest lib/graph/libSbGraph.a -lboost_python3 /usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a && : /usr/bin/ld: /usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a(thread.o): undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3' //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status [13/18] Building CXX object app/CMakeF.../antimony.dir/export/export_mesh.cpp.o ../app/export/export_mesh.cpp: In member function ‘virtual void ExportMeshWorker::async()’: ../app/export/exportmesh.cpp:79:5: warning: missing initializer for member ‘Region::voxels’ [-Wmissing-field-initializers] }; ^ ../app/export/exportmesh.cpp:79:5: warning: missing initializer for member ‘Region::X’ [-Wmissing-field-initializers] ../app/export/exportmesh.cpp:79:5: warning: missing initializer for member ‘Region::Y’ [-Wmissing-field-initializers] ../app/export/exportmesh.cpp:79:5: warning: missing initializer for member ‘Region::Z’ [-Wmissing-field-initializers] ../app/export/exportmesh.cpp:79:5: warning: missing initializer for member ‘Region::L’ [-Wmissing-field-initializers] [14/18] Building CXX object app/CMakeF...mony.dir/export/export_heightmap.cpp.o ../app/export/export_heightmap.cpp: In member function ‘virtual void ExportHeightmapWorker::async()’: ../app/export/exportheightmap.cpp:83:5: warning: missing initializer for member ‘Region::voxels’ [-Wmissing-field-initializers] }; ^ ../app/export/exportheightmap.cpp:83:5: warning: missing initializer for member ‘Region::X’ [-Wmissing-field-initializers] ../app/export/exportheightmap.cpp:83:5: warning: missing initializer for member ‘Region::Y’ [-Wmissing-field-initializers] ../app/export/exportheightmap.cpp:83:5: warning: missing initializer for member ‘Region::Z’ [-Wmissing-field-initializers] ../app/export/exportheightmap.cpp:83:5: warning: missing initializer for member ‘Region::L’ [-Wmissing-field-initializers] [15/18] Building CXX object app/CMakeF...ntimony.dir/export/export_worker.cpp.o ninja: build stopped: subcommand failed.