ground_estimation linking problems

Issue #135 new
Sam-Nicolai Johnston
created an issue

Hello,

Versions:

  • Ubuntu: 16.04
  • OpenCV: 2.4.13
  • CUDA toolkit: 8.0

Problem:

I'm trying to get Step 2: compile CPU only code to work, but I'm having some linking problems. When, I run make, there's an error when linking the executable:

[100%] Linking CXX executable ground_estimation
/usr/bin/ld: /usr/local/lib/libopencv_core.a(persistence.cpp.o): undefined reference to symbol 'gzclose'
//lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/ground_estimation.dir/build.make:1792: recipe for target 'ground_estimation' failed
make[2]: *** [ground_estimation] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ground_estimation.dir/all' failed
make[1]: *** [CMakeFiles/ground_estimation.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

It seems to be a problem with the way the libraries are linked, but I can't figure out why or how to solve it.

Thanks for any help! Sam

Comments (5)

  1. Shinichiro Murakami

    I found the solution. Just comment out opencv libraries as below. I think the order of linking library is wrong. When you comment out the lines, cmake finds proper libs based on pkg-config.

    #set(opencv_LIBRARIES
    #    opencv_core opencv_imgproc opencv_highgui opencv_ml
    #    opencv_video opencv_features2d
    #    opencv_calib3d
    #    opencv_objdetect opencv_contrib
    #    opencv_legacy opencv_flann
    #    opencv_gpu
    #   ) # quick hack for opencv2.4 support
    
  2. Log in to comment