编译问题

zml@zml:~/try/catkin_ws/src/ORB_Segmentation/build$ make 
[ 50%] Linking CXX executable ../bin/orb_segmentation
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyUnicodeUCS4_FromEncodedObject’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyNumber_InPlaceDivide’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyString_Size’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyString_FromStringAndSize’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyString_InternFromString’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyInt_AsLong’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyUnicodeUCS4_AsWideChar’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyString_AsString’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyString_FromFormat’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyClass_Type’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyString_FromString’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyFile_AsFile’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘Py_InitModule4_64’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyInt_Type’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyInt_FromLong’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyFile_FromString’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyNumber_Divide’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so:对‘PyString_Type’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/orb_segmentation.dir/build.make:160: recipe for target '../bin/orb_segmentation' failed
make[2]: *** [../bin/orb_segmentation] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/orb_segmentation.dir/all' failed
make[1]: *** [CMakeFiles/orb_segmentation.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

因为我编译安装用的Python3.5,所以

cd /usr/lib/x86_64-linux-gnu/
sudo unlink libboost_python.so
sudo unlink libboost_python.a
sudo ln -s usr/lib/x86_64-linux-gnu/libboost_python-py35.so usr/lib/x86_64-linux-gnu/libboost_python.so
sudo ln -s usr/lib/x86_64-linux-gnu/libboost_python-py35.a  usr/lib/x86_64-linux-gnu/libboost_python.a

 

你可能感兴趣的:(编译问题)