How to use CMAKE to get debug libraries for OpenCV
Hello everyone
I am new to using OpenCV on Linux and I have run into the following problem: I am trying to write some first C++ applications using OpenCV. I downloaded the source code (v.3.4.5) for OpenCV from their webpage. Then I compiled the source code using CMAKE, make and make install. So far everything went okay and I can compile and run the first example:https://docs.opencv.org/3.2.0/db/df5...gcc_cmake.html The problem is that when I try to compile the application in Debug mode using QtCreator, the same code as in the example won't work. Now I assume that is because I need to link the debug libraries for OpenCV when debugging, however, I'm not sure how I can get the debug libraries from the source code. So far I basically tried the following commands in the source-code Code:
cmake -D WITH_QT=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local .. Code:
sudo find / -name libopencv_cored.so The CMAKE code for my project currently looks like this: Code:
cmake_minimum_required(VERSION 2.8) Code:
#include <stdio.h> |
The cmake target_link_libraries and Transitive Usage Requirements reference pages probably have the information you are missing.
I understand just enough cmake to build projects which use it, but have not used it as the build environment for any of my own, so cannot offer much more help. Look over the above links and you should be able to resolve your issue. Good luck! |
All times are GMT -5. The time now is 11:41 PM. |