OpenCV2.4.6 + CUDA5.0 + VS2010, in debug mode, don

2020-05-04 10:14发布

问题:

winodws 7, 64-bit, Graphics adapter is NVIDIA GeForce GT 610, I have correctly installed the graphics driver and CUDA 5, I use CMake correctly compiled OpenCV2.4.6 + GPU.In Release mode, everything is normal, but, in Debug mode, the image can not be displayed(For example, namedWindow function can not be performed). Debug Error:OpenCV Error, Unspecified error . I uninstalled OpenCV, than I installed GTK2, restart the computer, I installed OpenCV again. Release mode, it is normal, Debug mode is still wrong, it can't show images. I repeated several times, still does not solve the problem. Please help me in solving this problem. Thanks in advance.

回答1:

Use CMake to link libraries and include directories. It makes your life easier and also for anyone else who will be extending/reading your code in the future.

For example, to link OpenCV, use the follow lines of code:

FIND_PACKAGE( OpenCV REQUIRED )
TARGET_LINK_LIBRARIES( myProject ${OpenCV_LIBS} )


回答2:

Be sure to link the debug libraries and only the debug libraries. I once had this problem while mixing debug and non debug libraries in debug mode.



标签: opencv cuda