简体   繁体   中英

Linking errors for Qt and cvv when building OpenCV in Windows 10

I am trying to build OpenCV according to these instructions . After generating with CMake I opened OpenCV.sln in the build folder, switched to Release mode and built ALL_BUILD successfully. But when I try to build the INSTALL option under CMake, I get errors like this:

Error   LNK2001 unresolved external symbol "public: virtual struct QMetaObject const * __cdecl cvv::qtutil::Signal::metaObject(void)const " 
Error   LNK2019 unresolved external symbol "public: void __cdecl cvv::qtutil::ZoomableImage::updateConversionResult(class cv::Mat const &,enum cvv::qtutil::ImageConversionResult)const " 
...

I am installing OpenCV 4.2 on Windows 10 with Visual Studio 19. How can I solve this problem?

Here is an image of the error messages in Visual Studio:

在此处输入图片说明

Turning my comments into an answer:

The GitHub issue described here references similar errors to those you have posted. While the suggested "solution" seems more like a work-around, it may help resolve the issue. First, try building without thecvv module (an interactive GUI component of OpenCV), by running CMake with the BUILD_opencv_cvv variable set to OFF :

cmake -DBUILD_opencv_cvv=OFF ...

You can also set the variable using the CMake GUI, by clicking the Add Entry button, and defining BUILD_opencv_cvv to OFF .

The GitHub issue further explains that if there are still undefined reference errors after making this change, you can also try setting BUILD_opencv_world to OFF as well.

cmake -DBUILD_opencv_cvv=OFF -DBUILD_opencv_world=OFF ...

This may help get things building successfully, but it should be noted that these disabled modules will be left out of your build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM