Qt + Cmake-GUI + OpenCV - 链接CXX共享库错误

时间:2018-03-07 07:04:45

标签: qt opencv cmake cmake-gui

我正在尝试使用QT v5.10.1和cmake-gui设置OpenCV图像处理库v3.4.1:https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows。我使用的是Windows 7 64位。

我已完全按照所有说明操作但当我运行命令mingw32-make时出现以下错误:

[ 40%] Linking CXX shared library ..\..\bin\libopencv_core341.dll
CMakeFiles\opencv_core.dir/objects.a: member CMakeFiles\opencv_core.dir/objects.
a(vs_version.rc.obj) in archive is not an object
collect2.exe: error: ld returned 1 exit status
modules\core\CMakeFiles\opencv_core.dir\build.make:2329: recipe for target 'bin/
libopencv_core341.dll' failed
mingw32-make[2]: *** [bin/libopencv_core341.dll] Error 1
CMakeFiles\Makefile2:1624: recipe for target 'modules/core/CMakeFiles/opencv_cor
e.dir/all' failed
mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

我无休止地寻找解决方案,但迄今为止没有任何工作。

感谢任何帮助,谢谢!

1 个答案:

答案 0 :(得分:0)

希望您找到了解决此问题的方法。我建议您先安装Git。然后在系统环境变量上添加路径。然后打开cmak-gui并删除缓存。然后,在该文件夹上,您尝试创建cmake文件。也将其删除。 然后再次配置并通过cmake-gui创建。 这个对我有用。 祝你好运