baidu / boteye

210 stars 72 forks source link

compile error about libgflags.so.2 /usr/lib/x86_64-linux-gnu/libglog.so, conflict with libgflags.so.2.2 #51

Open narutojxl opened 5 years ago

narutojxl commented 5 years ago

First source ~/XP_release/3rdparty_lib_lean/update.sh, then put lib_x86_64 folder at boteye repo, when build, its output about error is

/usr/bin/ld: warning: libgflags.so.2, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64- linux-gnu/libglog.so, may conflict with libgflags.so.2.2 /usr/bin/ld: CMakeFiles/pose_receiver.dir/app_pose_receiver.cpp.o: undefined reference to symbol '_ZN6google14FlagRegistererC1EPKcS2_S2_S2PvS3' //usr/lib/x86_64-linux-gnu/libgflags.so.2: error adding symbols: DSO missing from command line

In my ubuntu16.04 machine,

jxl@dell:/usr/lib/x86_64-linux-gnu$ ls libglog libglog.a libglog.so libglog.so.0 libglog.so.0.0.0 jxl@dell:/usr/lib/x86_64-linux-gnu$ ls libgflag libgflags.a libgflags_nothreads.a libgflags_nothreads.so libgflags_nothreads.so.2
libgflags_nothreads.so.2.1.2 libgflags.so libgflags.so.2 libgflags.so.2.1.2 jxl@dell:/usr/lib/x86_64-linux-gnu$

jxl@dell:~/$ sudo apt-get install libgflags-dev libgoogle-glog-dev libgflags-dev 已经是最新版 (2.1.2-3)。 libgoogle-glog-dev 已经是最新版 (0.3.4-0.1)。

The detailed error is as follows:

jxl@dell:~/XP_release/boteye/apps/build$ make -j12 [ 7%] Building CXX object app_tracking/CMakeFiles/guide_receiver.dir/app_guide_receiver.cpp.o [ 14%] Building CXX object app_tracking/CMakeFiles/pose_receiver.dir/app_pose_receiver.cpp.o [ 21%] Building CXX object app_tracking/CMakeFiles/pose_receiver.dir/plotting_utils.cpp.o [ 35%] Building CXX object cam_calibration/CMakeFiles/cam_calibration.dir/verification.cpp.o [ 35%] Building CXX object cam_calibration/CMakeFiles/cam_calibration.dir/cam_calibration.cpp.o [ 42%] Building CXX object xp_sensor_logger/CMakeFiles/xp_sensor_logger.dir/xp_sensor_logger.cpp.o [ 50%] Building CXX object app_tracking/CMakeFiles/app_tracking.dir/app_tracking.cpp.o [ 57%] Building CXX object app_tracking/CMakeFiles/app_tracking.dir/plotting_utils.cpp.o [ 64%] Building CXX object app_tracking/CMakeFiles/app_tracking.dir/xp_driver_interface.cc.o [ 71%] Linking CXX executable guide_receiver [ 71%] Built target guide_receiver [ 78%] Linking CXX executable pose_receiver /usr/bin/ld: warning: libgflags.so.2, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so, may conflict with libgflags.so.2.2 /usr/bin/ld: CMakeFiles/pose_receiver.dir/app_pose_receiver.cpp.o: undefined reference to symbol '_ZN6google14FlagRegistererC1EPKcS2_S2_S2PvS3' //usr/lib/x86_64-linux-gnu/libgflags.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status app_tracking/CMakeFiles/pose_receiver.dir/build.make:145: recipe for target 'app_tracking/pose_receiver' failed make[2]: [app_tracking/pose_receiver] Error 1 CMakeFiles/Makefile2:163: recipe for target 'app_tracking/CMakeFiles/pose_receiver.dir/all' failed make[1]: [app_tracking/CMakeFiles/pose_receiver.dir/all] Error 2 make[1]: 正在等待未完成的任务.... [ 85%] Linking CXX executable cam_calibration [ 92%] Linking CXX executable xp_sensor_logger /usr/bin/ld: warning: libgflags.so.2, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so, may conflict with libgflags.so.2.2 /usr/bin/ld: CMakeFiles/cam_calibration.dir/cam_calibration.cpp.o: undefined reference to symbol '_ZN6google14FlagRegistererC1EPKcS2_S2_S2PvS3' //usr/lib/x86_64-linux-gnu/libgflags.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status cam_calibration/CMakeFiles/cam_calibration.dir/build.make:153: recipe for target 'cam_calibration/cam_calibration' failed make[2]: [cam_calibration/cam_calibration] Error 1 CMakeFiles/Makefile2:273: recipe for target 'cam_calibration/CMakeFiles/cam_calibration.dir/all' failed make[1]: [cam_calibration/CMakeFiles/cam_calibration.dir/all] Error 2 /usr/bin/ld: warning: libgflags.so.2, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so, may conflict with libgflags.so.2.2 /usr/bin/ld: CMakeFiles/xp_sensor_logger.dir/xp_sensor_logger.cpp.o: undefined reference to symbol '_ZN6google14FlagRegistererC1EPKcS2_S2_S2PvS3' //usr/lib/x86_64-linux-gnu/libgflags.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status xp_sensor_logger/CMakeFiles/xp_sensor_logger.dir/build.make:127: recipe for target 'xp_sensor_logger/xp_sensor_logger' failed make[2]: [xp_sensor_logger/xp_sensor_logger] Error 1 CMakeFiles/Makefile2:218: recipe for target 'xp_sensor_logger/CMakeFiles/xp_sensor_logger.dir/all' failed make[1]: [xp_sensor_logger/CMakeFiles/xp_sensor_logger.dir/all] Error 2 [100%] Linking CXX executable app_tracking /usr/bin/ld: warning: libgflags.so.2, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so, may conflict with libgflags.so.2.2 /usr/bin/ld: CMakeFiles/app_tracking.dir/app_tracking.cpp.o: undefined reference to symbol '_ZN6google14FlagRegistererC1EPKcS2_S2_S2PvS3' //usr/lib/x86_64-linux-gnu/libgflags.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status app_tracking/CMakeFiles/app_tracking.dir/build.make:179: recipe for target 'app_tracking/app_tracking' failed make[2]: [app_tracking/app_tracking] Error 1 CMakeFiles/Makefile2:89: recipe for target 'app_tracking/CMakeFiles/app_tracking.dir/all' failed make[1]: [app_tracking/CMakeFiles/app_tracking.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: [all] Error 2 jxl@dell:~/XP_release/boteye/apps/build$

Thanks a lot!