stereolabs/zed-openpose

//usr/local/lib/libgflags.so.2.2: error adding symbols: DSO missing from command line

cloudhy417-ntu opened this issue · 4 comments

I cloned openpose and built it without issue. However, when I cloned this repo and build it, I encountered the following error when I run make.

[ 33%] Linking CXX executable zed_openpose
/usr/bin/ld: CMakeFiles/zed_openpose.dir/src/main.o: undefined reference to symbol '_ZN6gflags14FlagRegistererC1IdEEPKcS3_S3_PT_S5_'
//usr/local/lib/libgflags.so.2.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/zed_openpose.dir/build.make:157: recipe for target 'zed_openpose' failed
make[2]: *** [zed_openpose] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/zed_openpose.dir/all' failed
make[1]: *** [CMakeFiles/zed_openpose.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Also, I got a warning message during cmake:

CMake Warning at CMakeLists.txt:44 (ADD_EXECUTABLE):
  Cannot generate a safe linker search path for target zed_openpose because
  files in some directories may conflict with libraries in implicit
  directories:

     link library [libglog.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib

   Some of these libraries may not be found correctly.

Not sure if it has something to do with the error I encountered.

My system is Ubuntu18 with cuda 10.
And glog and gflags are installed from the newest source.
What can I do to fix this.
Thank for your kindly advices.

I cloned openpose and built it without issue. However, when I cloned this repo and build it, I encountered the following error when I run make.

[ 33%] Linking CXX executable zed_openpose
/usr/bin/ld: CMakeFiles/zed_openpose.dir/src/main.o: undefined reference to symbol '_ZN6gflags14FlagRegistererC1IdEEPKcS3_S3_PT_S5_'
//usr/local/lib/libgflags.so.2.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/zed_openpose.dir/build.make:157: recipe for target 'zed_openpose' failed
make[2]: *** [zed_openpose] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/zed_openpose.dir/all' failed
make[1]: *** [CMakeFiles/zed_openpose.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Also, I got a warning message during cmake:

CMake Warning at CMakeLists.txt:44 (ADD_EXECUTABLE):
  Cannot generate a safe linker search path for target zed_openpose because
  files in some directories may conflict with libraries in implicit
  directories:

     link library [libglog.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib

   Some of these libraries may not be found correctly.

Not sure if it has something to do with the error I encountered.

My system is Ubuntu18 with cuda 10.
And glog and gflags are installed from the newest source.
What can I do to fix this.
Thank for your kindly advices.

Hi, I got the same error. Did you fix it? If so, please tell me how. Thank you very much.

I also got the same error. Was anyone able to fix it yet? Thanks in advance!

Hi, just make sure libgflags-dev is installed in your system.
And add gflags to the CMakeLists.txt

target_link_libraries(${execName}
                        ${OpenPose_LIBS} ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS}
                        ${ZED_LIBRARIES}
                        ${GLUT_LIBRARY}
                        ${GLEW_LIBRARIES}
                        ${SPECIAL_OS_LIBS}
                        ${OPENGL_LIBRARIES}
                        ${OpenCV_LIBRARIES}
                        ${CUDA_CUDA_LIBRARY} ${CUDA_CUDART_LIBRARY} ${CUDA_NPP_LIBRARIES_ZED} gflags)

change ${GFLAGS_LIBRARY} to ${GFLAGS_LIBRARIES}