简体   繁体   English

在 Windows 10 中构建 OpenCV 时 Qt 和 cvv 的链接错误

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

I am trying to build OpenCV according to these instructions .我正在尝试根据这些说明构建OpenCV After generating with CMake I opened OpenCV.sln in the build folder, switched to Release mode and built ALL_BUILD successfully.使用CMake生成后,我在 build 文件夹中打开OpenCV.sln ,切换到 Release 模式并成功构建ALL_BUILD But when I try to build the INSTALL option under CMake, I get errors like this:但是当我尝试在 CMake 下构建INSTALL选项时,我收到如下错误:

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?我正在使用 Visual Studio 19 在 Windows 10 上安装 OpenCV 4.2。我该如何解决这个问题?

Here is an image of the error messages in Visual Studio:这是 Visual Studio 中错误消息的图像:

在此处输入图片说明

Turning my comments into an answer:把我的评论变成答案:

The GitHub issue described here references similar errors to those you have posted.此处描述的 GitHub 问题引用了与您发布的错误类似的错误。 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 :首先,通过在BUILD_opencv_cvv变量设置为OFF下运行 CMake,尝试在没有cvv模块(OpenCV 的交互式 GUI 组件)的情况下进行BUILD_opencv_cvv

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 .您还可以使用 CMake GUI 设置变量,方法是单击添加条目按钮,并将BUILD_opencv_cvv定义为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. GitHub issue 进一步说明,如果进行此更改后仍然存在未定义的引用错误,您也可以尝试将BUILD_opencv_world设置为OFF

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.这可能有助于成功构建事物,但应该注意的是,这些禁用的模块将被排除在您的构建之外。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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