Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors with recent version of CMake (2.8.7) #1

Open
kitizz opened this issue Jun 10, 2014 · 0 comments
Open

Build errors with recent version of CMake (2.8.7) #1

kitizz opened this issue Jun 10, 2014 · 0 comments

Comments

@kitizz
Copy link

kitizz commented Jun 10, 2014

I tried building the library in Ubuntu 12.04, OpenCV 2.2 (also attempted other configurations), and kept getting an error like the following:

/usr/bin/c++    -Wall -DNDEBUG -O3 -fopenmp -funroll-loops -march=native -mtune=native --fast-math -mfpmath=sse -msse3     CMakeFiles
/object_detection.dir/home/kit/Downloads/barinova_pedestrians_detection/ObjectDetection/main_run_greedy_pedestrians.cpp.o CMakeFiles/
object_detection.dir/home/kit/Downloads/barinova_pedestrians_detection/ObjectDetection/DenseGreedyDetection/GreedyDetection.cpp.o CMa
keFiles/object_detection.dir/home/kit/Downloads/barinova_pedestrians_detection/ObjectDetection/Forests/HoughForest.cpp.o CMakeFiles/o
bject_detection.dir/home/kit/Downloads/barinova_pedestrians_detection/ObjectDetection/Forests/IHoughForest.cpp.o CMakeFiles/object_de
tection.dir/home/kit/Downloads/barinova_pedestrians_detection/ObjectDetection/Forests/IHoughTree.cpp.o CMakeFiles/object_detection.di
r/home/kit/Downloads/barinova_pedestrians_detection/ObjectDetection/Forests/HoughTree.cpp.o CMakeFiles/object_detection.dir/home/kit/
Downloads/barinova_pedestrians_detection/ObjectDetection/Forests/Vote.cpp.o CMakeFiles/object_detection.dir/home/kit/Downloads/barino
va_pedestrians_detection/ObjectDetection/ImageWrapper/HoG.cpp.o CMakeFiles/object_detection.dir/home/kit/Downloads/barinova_pedestria
ns_detection/ObjectDetection/ImageWrapper/MultiImageTools.cpp.o CMakeFiles/object_detection.dir/home/kit/Downloads/barinova_pedestria
ns_detection/ObjectDetection/ImageWrapper/CRPatch.cpp.o  -o object_detection -rdynamic -lboost_filesystem-mt -lboost_system-mt -lgomp
 -ltbb -lrt -lpthread -lm -ldl
CMakeFiles/object_detection.dir/home/kit/Downloads/barinova_pedestrians_detection/ObjectDetection/main_run_greedy_pedestrians.cpp.o:
In function `HoG::~HoG()':
main_run_greedy_pedestrians.cpp:(.text._ZN3HoGD2Ev[_ZN3HoGD5Ev]+0x9): undefined reference to `cvReleaseMat'
main_run_greedy_pedestrians.cpp:(.text._ZN3HoGD2Ev[_ZN3HoGD5Ev]+0x12): undefined reference to `cvReleaseMat'
main_run_greedy_pedestrians.cpp:(.text._ZN3HoGD2Ev[_ZN3HoGD5Ev]+0x1b): undefined reference to `cvReleaseMat'
main_run_greedy_pedestrians.cpp:(.text._ZN3HoGD2Ev[_ZN3HoGD5Ev]+0x24): undefined reference to `cvReleaseMat'
main_run_greedy_pedestrians.cpp:(.text._ZN3HoGD2Ev[_ZN3HoGD5Ev]+0x2d): undefined reference to `cvReleaseMat'

etc...

The issue was cmake not finding the opencv libraries properly.

I needed to change pkg_check_modules(opencv REQUIRED opencv>=2.1) to find_package( OpenCV 2.1 REQUIRED )

and target_link_libraries(... ${opencv_LIBRARIES} ) to target_link_libraries(... ${opencv_LIBS} )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant