hengli / camodocal

CamOdoCal: Automatic Intrinsic and Extrinsic Calibration of a Rig with Multiple Generic Cameras and Odometry
Other
1.18k stars 390 forks source link

Compilation error - cannot link boost library #11

Closed jdushy closed 8 years ago

jdushy commented 9 years ago

When I tried to compile the compilations haults with an error saying that it cannot see boost functions while linking. However, I made sure I installed boost in my Ubuntu system.

Here is the error msg:

CMakeFiles/camodocal_features2d.dir/ORBGPU.cc.o: In function boost::thread_exception::thread_exception(int, char const*)': ORBGPU.cc:(.text._ZN5boost16thread_exceptionC2EiPKc[_ZN5boost16thread_exceptionC5EiPKc]+0x1b): undefined reference toboost::system::system_category()' CMakeFiles/camodocal_features2d.dir/ORBGPU.cc.o: In function _GLOBAL__sub_I_ORBGPU.cc': ORBGPU.cc:(.text.startup+0x12): undefined reference toboost::system::generic_category()' ORBGPU.cc:(.text.startup+0x29): undefined reference to boost::system::generic_category()' ORBGPU.cc:(.text.startup+0x34): undefined reference toboost::system::system_category()' CMakeFiles/camodocal_features2d.dir/SurfGPU.cc.o: In function _GLOBAL__sub_I_SurfGPU.cc': SurfGPU.cc:(.text.startup+0x15): undefined reference toboost::system::generic_category()' SurfGPU.cc:(.text.startup+0x2c): undefined reference to boost::system::generic_category()' SurfGPU.cc:(.text.startup+0x37): undefined reference toboost::system::system_category()' collect2: error: ld returned 1 exit status make[2]: *\ [lib/libcamodocal_features2d.so] Error 1

xiaozhuchacha commented 9 years ago

I solved this issue by adding following link statement to src/feature2d/CMakeLists.txt

${Boost_LIBRARIES}

The new link libraries should look like

camodocal_link_libraries(camodocal_features2d ${OPENCV_CORE_LIBRARY} ${OPENCV_NONFREE_LIBRARY} ${OPENCV_GPU_LIBRARY} ${Boost_LIBRARIES} )

ahundt commented 8 years ago

I believe this was fixed in #33, feel free to reopen if the issue persists.