在Windows 10中构建OpenCV时Qt和cvv的链接错误 [英] Linking errors for Qt and cvv when building OpenCV in Windows 10

查看:59
本文介绍了在Windows 10中构建OpenCV时Qt和cvv的链接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据

解决方案

将我的评论变成答案:

此处所述的GitHub问题引用了与您所发布的错误类似的错误.虽然建议的解决方案"似乎更像是一种变通方法,但它可能有助于解决问题.首先,尝试在没有 cvv 的情况下进行构建模块(OpenCV的交互式GUI组件),方法是将CMake的 BUILD_opencv_cvv 变量设置为 OFF :

  cmake -DBUILD_opencv_cvv = OFF ... 

您还可以使用CMake GUI设置变量,方法是单击添加条目按钮,并将 BUILD_opencv_cvv 定义为 OFF .

>

GitHub问题进一步说明,如果进行此更改后仍然存在未定义的参考错误,您还可以尝试将 BUILD_opencv_world 设置为 OFF .

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

这可能有助于成功构建内容,但应注意,这些禁用的模块将被排除在构建之外.

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 the cvv 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.

这篇关于在Windows 10中构建OpenCV时Qt和cvv的链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆