uoip / pangolin

Python binding of 3D visualization library Pangolin
MIT License
285 stars 90 forks source link

make error #27

Open quqxui opened 4 years ago

quqxui commented 4 years ago

/usr/bin/ld: /usr/local/lib/libpython3.6m.a(dynload_shlib.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status examples/SimplePlot/CMakeFiles/SimplePlot.dir/build.make:113: recipe for target 'examples/SimplePlot/SimplePlot' failed make[2]: [examples/SimplePlot/SimplePlot] Error 1 CMakeFiles/Makefile2:543: recipe for target 'examples/SimplePlot/CMakeFiles/SimplePlot.dir/all' failed make[1]: [examples/SimplePlot/CMakeFiles/SimplePlot.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... /usr/bin/ld: /usr/local/lib/libpython3.6m.a(dynload_shlib.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status examples/HelloPangolin/CMakeFiles/HelloPangolin.dir/build.make:113: recipe for target 'examples/HelloPangolin/HelloPangolin' failed make[2]: [examples/HelloPangolin/HelloPangolin] Error 1 CMakeFiles/Makefile2:323: recipe for target 'examples/HelloPangolin/CMakeFiles/HelloPangolin.dir/all' failed make[1]: [examples/HelloPangolin/CMakeFiles/HelloPangolin.dir/all] Error 2 /usr/bin/ld: /usr/local/lib/libpython3.6m.a(dynload_shlib.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status examples/SimpleDisplayImage/CMakeFiles/SimpleDisplayImage.dir/build.make:113: recipe for target 'examples/SimpleDisplayImage/SimpleDisplayImage' failed make[2]: [examples/SimpleDisplayImage/SimpleDisplayImage] Error 1 CMakeFiles/Makefile2:433: recipe for target 'examples/SimpleDisplayImage/CMakeFiles/SimpleDisplayImage.dir/all' failed make[1]: [examples/SimpleDisplayImage/CMakeFiles/SimpleDisplayImage.dir/all] Error 2 /usr/bin/ld: /usr/local/lib/libpython3.6m.a(dynload_shlib.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status examples/SimpleMultiDisplay/CMakeFiles/SimpleMultiDisplay.dir/build.make:113: recipe for target 'examples/SimpleMultiDisplay/SimpleMultiDisplay' failed make[2]: [examples/SimpleMultiDisplay/SimpleMultiDisplay] Error 1 CMakeFiles/Makefile2:378: recipe for target 'examples/SimpleMultiDisplay/CMakeFiles/SimpleMultiDisplay.dir/all' failed make[1]: [examples/SimpleMultiDisplay/CMakeFiles/SimpleMultiDisplay.dir/all] Error 2 /usr/bin/ld: /usr/local/lib/libpython3.6m.a(dynload_shlib.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status examples/SimpleVideo/CMakeFiles/SimpleVideo.dir/build.make:113: recipe for target 'examples/SimpleVideo/SimpleVideo' failed make[2]: [examples/SimpleVideo/SimpleVideo] Error 1 CMakeFiles/Makefile2:653: recipe for target 'examples/SimpleVideo/CMakeFiles/SimpleVideo.dir/all' failed make[1]: [examples/SimpleVideo/CMakeFiles/SimpleVideo.dir/all] Error 2 In file included from /home/aa/pypangolin/pangolin/python/gl/gl.hpp:5:0, from /home/aa/pypangolin/pangolin/python/pangolin.cpp:24: /home/aa/pypangolin/pangolin/python/gl/colour.hpp:14:33: warning: unused parameter ‘m’ [-Wunused-parameter] void declareColour(py::module & m) { ^ [ 85%] Linking CXX executable SimpleScene /usr/bin/ld: /usr/local/lib/libpython3.6m.a(dynload_shlib.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status examples/SimpleScene/CMakeFiles/SimpleScene.dir/build.make:113: recipe for target 'examples/SimpleScene/SimpleScene' failed make[2]: [examples/SimpleScene/SimpleScene] Error 1 CMakeFiles/Makefile2:488: recipe for target 'examples/SimpleScene/CMakeFiles/SimpleScene.dir/all' failed make[1]: [examples/SimpleScene/CMakeFiles/SimpleScene.dir/all] Error 2 [ 86%] Linking CXX executable SimpleDisplay /usr/bin/ld: /usr/local/lib/libpython3.6m.a(dynload_shlib.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status examples/SimpleDisplay/CMakeFiles/SimpleDisplay.dir/build.make:113: recipe for target 'examples/SimpleDisplay/SimpleDisplay' failed make[2]: [examples/SimpleDisplay/SimpleDisplay] Error 1 CMakeFiles/Makefile2:598: recipe for target 'examples/SimpleDisplay/CMakeFiles/SimpleDisplay.dir/all' failed make[1]: [examples/SimpleDisplay/CMakeFiles/SimpleDisplay.dir/all] Error 2 [ 87%] Linking CXX shared module ../../pangolin.cpython-36m-x86_64-linux-gnu.so /usr/bin/ld: /usr/local/lib/libpython3.6m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libpython3.6m.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status python/CMakeFiles/pangolin.dir/build.make:113: recipe for target '../pangolin.cpython-36m-x86_64-linux-gnu.so' failed make[2]: [../pangolin.cpython-36m-x86_64-linux-gnu.so] Error 1 CMakeFiles/Makefile2:190: recipe for target 'python/CMakeFiles/pangolin.dir/all' failed make[1]: [python/CMakeFiles/pangolin.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: [all] Error 2

mshong0320 commented 4 years ago

I'm getting the same error. What's the fix for this?

patosai commented 4 years ago

You need the dynamic library (.so), something like libpython3.6.so. You're using the static library /usr/local/lib/libpython3.6m.a