I am writing a Universal Windows application that uses OpenCV to do camera calibration and tag detection, among other things.
I'd like to be able to use release mode, fully-optimized OpenCV DLLs while my own is in debug mode. Is this possible? If so, how do I configure CMake to make it happen?
I do want to debug my own application, naturally. However, I do not want to debug OpenCV itself. I do not want to deal with the performance drop of an OpenCV debug build, even while I'm debugging my own project. I do not want to deal with the overhead of the additional libs and dlls, and setting up my build configuration properly (this is part of a larger project, including a Unity app, so build configuration is a significant issue).
I'm using OpenCV DLLs, not static libs, so issues of differences in implementations of the STD library, etc. should not make any difference (unless OpenCV is passing those across the DLL boundary... which would be naughty indeed). Yet, when I try to build my app in Debug mode, while referencing OpenCV Release DLLs, I encounter the debug_build_guard:
error LNK2019: unresolved external symbol "bool __cdecl cv::imencode(class cv::String const &,class cv::debug_build_guard::_InputArray const &,...
It seems like what I want would be a really common use case. Unfortunately I can't seem to find anything about it anywhere. Thanks for any help!
Add CV_IGNORE_DEBUG_BUILD_GUARD
as one of the preprocessor definitions, which is defined in /path/to/opencv/opencv2/core/cvdef.h
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With