raulmur/BagFromImages

Unusual make error

sky-coder opened this issue · 5 comments

Hi, I got stumbled with the following unusual make error: Any insights would be appreciated!

[ 33%] Linking CXX executable ../bin/BagFromImages
/usr/bin/ld: CMakeFiles/BagFromImages.dir/main.cc.o: undefined reference to symbol '_ZN14console_bridge3logEPKciNS_8LogLevelES1_z'
/usr/lib/x86_64-linux-gnu/libconsole_bridge.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/BagFromImages.dir/build.make:219: recipe for target '../bin/BagFromImages' failed
make[2]: *** [../bin/BagFromImages] Error 1
CMakeFiles/Makefile2:677: recipe for target 'CMakeFiles/BagFromImages.dir/all' failed
make[1]: *** [CMakeFiles/BagFromImages.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

it's a problem of lib linkage. According to the error msg, libconsole_bridge should be linked apparently in CMakeLists.txt. like:

target_link_libraries (${PROJECT_NAME}
console_bridge)

Hope it will help you.

Thanks! @ZhengPan2014

Thanks!!!! @ZhengPan2014

Thanks!!!! @ZhengPan2014

I went ahead and added the following code to build successfully
target_link_libraries (${PROJECT_NAME} console_bridge boost_system boost_filesystem)