박현근
박현근

Reputation: 63

C++ Visual Studio release build is not working (OpenCV 4.5.2)

Now, I tried to build release mode from C++ source code with OpenCV.

This source code is built on debug mode, but it is not built on release mode.

The below images are my OpenCV library setting.

enter image description here

enter image description here

enter image description here

enter image description here

Please give me your help

1>------ Build started: Project: OpenCVServer, Configuration: Release x64 ------
1>StreamServer.obj : error LNK2001: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@1@@Z)
1>StreamServer.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::read(class cv::_OutputArray const &)" (?read@VideoCapture@cv@@UEAA_NAEBV_OutputArray@2@@Z)
1>C:\workspace\OpenCVStream\OpenCVServer\x64\Release\OpenCVServer.exe : fatal error LNK1120: 2 unresolved externals
1>Done building project "OpenCVServer.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Upvotes: 1

Views: 1576

Answers (1)

Arty
Arty

Reputation: 16747

The error is most probably happening because you provided OpenCV library named ...d.lib to your release linker configuration.

d suffix in library file name means that it is debug library. All .lib files are usually shipped as two files, one for release (without d) and one for debug (with d).

Try to find release .lib and place it into your linker configuration.

Upvotes: 3

Related Questions