Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

LNK2019 error only on debug compilation

Hello.

I'm new to OpenCV. I'm using OpenCV 4 on Visual Studio 2017 on a Windows 7 OS. I'm trying to compile the first tutorial app ' How to build applications with OpenCV inside the "Microsoft Visual Studio" '. It compiles and executes correctly on the release configuration, but it gives an LNK2019 linker error on the debug configuration. I compared the common library directories, C/C++ additional include directories, linker additional library directories and linker input additional dependencies properties for both Debug and Release configurations (x64) and are the same except for the final 'd' on debug libraries at additional dependencies.

The linker error is on imshow function, supposedly to be at opencv_imgcodecs412d.lib, which is correctly referenced at Debug|x64 -> Linker -> Input -> Additional dependencies.

These are the libraries included:

opencv_calib3d412d.lib opencv_core412d.lib opencv_dnn412d.lib opencv_features2d412d.lib opencv_flann412d.lib opencv_gapi412d.lib opencv_highgui412d.lib opencv_imgcodecs412d.lib opencv_imgproc412d.lib opencv_ml412d.lib opencv_objdetect412d.lib opencv_photo412d.lib opencv_stitching412d.lib opencv_video412d.lib opencv_videoio412d.lib

This is the error displayed:

Error LNK2019 símbolo externo "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,class cv::debug_build_guard::_InputArray const &)" (?imshow@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@debug_build_guard@1@@Z) sin resolver al que se hace referencia en la función main