OpenCV3.2.0 compilation linker error using cmake

asked 2019-04-13 07:36:09 -0600

I had recently by a mistake of mine, deleted the /usr/local/ folder and with it all of the binaries that were built by me contained in it. I had to reinstall the OpenCV and had to build caffe again which is required for my project. The issue now is that whenever I build my project there is this error that emerges during the build. I have googled but to not much of my help. I am using cmake to build my project.

[ 80%] Built target mygoturn
[ 80%] Linking CXX executable ../bin/runTracker
/usr/bin/ld: CMakeFiles/runTracker.dir/src/visualizer/runTracker.cpp.o: undefined reference to symbol '_ZN2cv6imreadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi'
//usr/local/lib/libopencv_imgcodecs.so.4.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/runTracker.dir/build.make:200: recipe for target '../bin/runTracker' failed
make[2]: *** [../bin/runTracker] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/runTracker.dir/all' failed
make[1]: *** [CMakeFiles/runTracker.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
edit retag flag offensive close merge delete