1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Qt 工程下使用 cmake MinGW OpenCV 4.1.1(涵盖 MinGW32 与 MinGW64)

Qt 工程下使用 cmake MinGW OpenCV 4.1.1(涵盖 MinGW32 与 MinGW64)

时间:2024-07-03 12:01:27

相关推荐

Qt 工程下使用 cmake MinGW OpenCV 4.1.1(涵盖 MinGW32 与 MinGW64)

OpenCV 官方没有编译好的 MinGW 版本,Qt 提供了 MinGW 编译方式,由于有一些开源项目利用的MinGW编译方式,想让 Qt 工程使用 MinGW OpenCV,需要自己使用 Cmake 编译 OpenCV

可选项:安装Git

你可以选择忽略此步,因为使用 cmd 与 PowerShell 也能进行,但是 OpenCV 4.1.1 的 Cmake 运用了 Chmod 使用 cmd 或 PowerShell 需要修改 Cmake 源码,后续会提到如何修改

选择安装平台 Windows 与你需要下载的版本,比如我安装的版本为 Git-2.24.0.2-64-bit,下载后打开一路点击 Next 最后 点击 Install 就行了

step1:下载Qt

Qt 提供 opensource 的版本,只需注册认证就能下载,也可以在我的百度云盘下载,密码:a0wh,我的版本是 Qt 5.12.5

下载打开后一路安装,选择所有插件全部安装,避免 Cmake 出现缺少插件的错误

,分别添加环境变量,配置 32 就只添加 32,配置 64 就删掉 32,只配置 64,因为 cmake 默认选项太多

D:\programing\Qt5.12.5\Tools\mingw730_32\binD:\programing\Qt5.12.5\Tools\mingw730_64\bin

Step2:下载OpenCV源码

我下载的OpenCV 4.1.1

选择要解压的地址:比如我的最后选择解压位置为:D:\programing\opencv

解压后有如下文件夹

Step3:下载Cmake

我下载的cmake-3.15.5-win64-x64.zip

解压文件,你可以选择将 bin 加入环境目录,这样你可以使用 cmd 命令行的方式进行编译

注意你的环境变量,发现在我的环境变量下出现了

D:\programing\TDM_GCC_64\bin

TDM_GCC_64是我当时使用MATLAB时使用的,不过后面下载安装了MATLAB自带的插件,就没什么用了,但是,这个文件支持MinGW,为了不让cmake 自动选择系统环境变量下的文件进行(可能会产生 x86 与 64 的混合,然而 x64 支持 x86,x86 不支持 x64),可以选择删除,我直接删除了

Step4:配置

32 位的 MinGW 安装如下:

cmake 中会有一些警告,后续会说明,🐟红不慌,才是一个稳重程序员应有的样子

打开 cmake-gui 我的位置位于:

D:\programing\cmake-3.15.5-win64-x64\cmake-3.15.5-win64-x64\bin

在 Cmake-gui 界面 两栏输入如下:

Where is the source code:D:/programing/opencv/sources (必须是source路径)

Where to build the binaries:D:/programing/opencv/OpenCVMinGW32 (这个文件夹可以自己任意指定,我编译的是 MinGW32 ,所以命名为 OpenCVMinGW32)

点击Configure,在下拉菜单中中选择MinGW Makefiles在四个选项中选择Specify native compilers点击Next

在弹出的窗口选择本地Compilers

C:D:/programing/Qt5.12.5/Tools/mingw730_32/bin/gcc.exe

C++:D:/programing/Qt5.12.5/Tools/mingw730_32/bin/g++.exe

点击Finish

坐等完成

完成后,有很多红色区域

勾选 WITH_OPENGL 与 WITH_QT,点击Configure,出现红色部分,确认这些文件夹路径是否正确,再次点击Configure,直到没有红色部分

点击Generate,坐等直到完成

出现 Qt5 Dir NotFound,需要手动添加,例如我的文件夹如下,注意32位

Qt5_DIR:D:\programing\Qt5.12.5\5.12.5\mingw73_32\lib\cmake\Qt5

每修改一次就 Configure 一次,直到 Configure done,没有错误,列表没有红色(或许会有一些无需在意的警告)

后面报错会讲解到

查看CMAKE_RC_COMPILER(windres.exe),这个配置隐藏较深,由于以前安装过树莓派配置文件或者什么原因,反正你要防止 cmake 使用默认环境变量含有MinGW的文件路径,我的文件目录如下(我甚至直接删除原来的环境变量),需要替换位 Qt 目录文件:

C:/Strawberry/c/bin/windres.exe → D:/programing/Qt5.12.5/Tools/mingw730_32/bin/windres.exe

你的目录应该如此:

下面是我的配置列表:

注意查看C++ CompilerC CompilerCMake build tool是否为匹配的 32 位,是否位Qt 目录下的文件,通过选择CMAKE_BUILD_TYPE的模式确定是Debug还是Release,我选择的Debug,如下:

General configuration for OpenCV 4.1.1 =====================================Version control:unknownPlatform:Timestamp: -12-23T17:37:34ZHost: Windows 10.0.18362 AMD64CMake: 3.15.5CMake generator: MinGW MakefilesCMake build tool: D:/programing/Qt5.12.5/Tools/mingw730_32/bin/mingw32-make.exeConfiguration:DebugCPU/HW features:Baseline:SSE SSE2requested: SSE2Dispatched code generation: SSE4_1 SSE4_2 FP16 AVXrequested: SSE4_1 SSE4_2 AVX FP16SSE4_1 (16 files): + SSE3 SSSE3 SSE4_1SSE4_2 (2 files):+ SSE3 SSSE3 SSE4_1 POPCNT SSE4_2FP16 (1 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVXAVX (5 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVXC/C++:Built as dynamic libs?:YESC++ Compiler:D:/programing/Qt5.12.5/Tools/mingw730_32/bin/g++.exe (ver 7.3.0)C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUGC++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUGC Compiler: D:/programing/Qt5.12.5/Tools/mingw730_32/bin/gcc.exeC flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -mfpmath=sse -fvisibility=hidden -O3 -DNDEBUG -DNDEBUGC flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -mfpmath=sse -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUGLinker flags (Release):-Wl,--gc-sections Linker flags (Debug): -Wl,--gc-sections ccache: NOPrecompiled headers: YESExtra dependencies:opengl32 glu323rdparty dependencies:OpenCV modules:To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo stitching ts video videoioDisabled:python3 python_bindings_generator python_tests worldDisabled by dependency:-Unavailable: java js python2 python2Applications:tests perf_tests appsDocumentation:NONon-free algorithms: NOWindows RT support: NOGUI: QT:YES (ver 5.12.5)QT OpenGL support: YES (Qt5::OpenGL 5.12.5)Win32 UI:YESOpenGL support: YES (opengl32 glu32)VTK support: NOMedia I/O: ZLib: build (ver 1.2.11)JPEG: build-libjpeg-turbo (ver 2.0.2-62)WEBP: build (ver encoder: 0x020e)PNG:build (ver 1.6.37)TIFF: build (ver 42 - 4.0.10)JPEG 2000: build (ver 1.900.1)OpenEXR: build (ver 2.3.0)HDR:YESSUNRASTER: YESPXM:YESPFM:YESVideo I/O:DC1394: NOFFMPEG: YES (prebuilt binaries)avcodec: YES (58.35.100)avformat: YES (58.20.100)avutil:YES (56.22.100)swscale: YES (5.3.100)avresample:YES (4.0.0)GStreamer: NODirectShow: YESParallel framework: noneTrace:YES (built-in)Other third-party libraries:Lapack: NOEigen: NOCustom HAL: NOProtobuf:build (3.5.1)OpenCL: YES (no extra features)Include path:D:/programing/opencv/sources/3rdparty/include/opencl/1.2Link libraries: Dynamic loadPython (for build): E:/Anaconda3/envs/tensorflow/python.exeJava:ant:NOJNI:NOJava wrappers:NOJava tests: NOInstall to:D:/programing/opencv/OpenCVMinGW32/install-----------------------------------------------------------------Configuring done

点击 Generate

等待:

Generating done

step5:使用Cmake 命令编译

打开 cmd 进入 D:\programing\opencv\OpenCVMinGW32,或者 在 D:\programing\opencv\OpenCVMinGW32 下按住Shift + 鼠标右键打开 Powershell 或者按住 Shift + 鼠标右键 打开Git Bash Here,输入mingw32-makemingw32-make -j 8-j 8代表八个线程,能加快运行速度,但要确定拥有足够的运行空间,可以使用 CPU-Z 查看线程数量

CPU-Z下载:下载地址

使用 Qt 自带的 mingw32-make,32位的位置在:

D:\programing\Qt5.12.5\Tools\mingw730_32\bin\mingw32-make

你可以将其添加环境变量,如果不加入环境变量,在命令输入时需要添加文件路径,如下:

D:\programing\Qt5.12.5\Tools\mingw730_32\bin\mingw32-makeD:\programing\Qt5.12.5\Tools\mingw730_32\bin\mingw32-make install

为了避免多线程出错,我仍然选择单线程编译:

运行时间较长,耐心等待,我自己运行时用的 PowerShell,手动滑稽🙃

成功运行结果如下:

成功后输入mingw32-make install,成功后如下

此时,你已经成功的 cmake 了 OpenCV 至MinGW32 Debug,其 D:\programing\opencv\OpenCVMinGW32\install\x86\mingw\bin 文件夹下有各种 DLL 文件,如下图,install就是需要的文件夹(名称为 libopencv_*d.dll,说明为 Debug 模式):

错误解决问题1:

如果使用mingw32-make -j 8出现错误,优先改用mingw32-make尝试,这个错误在任意进度都有可能出现,你可以尝试先运行,如果能运行通过则不修改

错误解决问题2:

如果使用的 cmd 与 PowerShell,由于Windows 平台不具有 Chmod 命令,所以你需要更改 Cmake 源码,更改如下:

在 D:\programing\opencv\sources\cmake\OpenCVPCHSupport错误ake 中311行处,注释或者删除如下第一行,更改为第二行

#COMMAND chmod +x "${_pch_generate_file_cmd}"${_pch_prepare_command}

修正后再次mingw32-makemingw32-make -j 8再次坐等

你可以尝试先运行,如果能运行通过则不修改,不出意外的话,应该会在36%左右出错

错误解决问题3:

最后还要拷贝 D:\programing\opencv\sources\modules\dnn\test\test_common.hpp 到 D:\programing\opencv\OpenCVMinGW32\modules\dnn 目录下

你可以尝试先运行,如果能运行通过则不修改,不出意外的话,应该会在93%左右出错

修正后再次mingw32-makemingw32-make -j 8再次坐等

错误解决问题4:

Anaconda 安装的 64 位 Python 与 32 位不兼容报错,在 cmake-gui 中取消勾选与 Python 有关的选项,在 Search 框中输入 python 取消掉:

BUILD_opencv_python3BUILD_opencv_python_bindings_generatorBUILD_opencv_python_tests

你可以尝试先运行,如果能运行通过则不修改,不出意外的话,应该会在100%左右出错

因为改变了 cmake 的选项,所以这次需要Configure → Generate → mingw32-make 或 mingw32-make -j 8

错误解决问题5:

编译 opencv/sources/modules/core/perf/opencl/perf_arithm.cpp 时候出错,错误原因是too many sections,file too big,原因是 build 过程中生成的.obj文件是COFF(Common Object File Format)格式,而COFF文件的header里有两位是表示number of sections的,不能超过32766,而这里汇编生成的obj的section超过了这个值,所以直接报错提示file too big

解决:

D:\programing\opencv\sources\CMakeLists.txt

添加如下:

if(MINGW)# Work around 'too many sections' error with MINGW/GCCset(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")endif()

解决方案参考于:github

完成后再次mingw32-make 或 mingw32-make -j 8

错误解决问题6:

warining:

CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):CONFIGURATION IS NOT SUPPORTED: validate setupvars script in installdirectoryCall Stack (most recent call first):CMakeLists.txt:1059 (include)

这是 Python 路径不对,由于此次不需要 Python 所以不必理睬,python 具有自己的 opencv-python pip 安装方式,最好取消如下选项:

BUILD_opencv_python3BUILD_opencv_python_bindings_generatorBUILD_opencv_python_tests

总结顺序如下:

添加 Qt 环境变量→去掉 python→勾选 WITH_QT→勾选 WITH_OPENGL→添加 QT_DIR→检查列表 exe→检查配置→编译→安装

64 位的 MinGW 安装如下:

添加环境变量:

D:\programing\Qt5.12.5\Tools\mingw730_64\bin

记住删除编译32时创建的环境变量

选择 64 位的Qt gcc,g++,Configure,检查,勾选:

我的配置如下:

我选择的 Release 模式

General configuration for OpenCV 4.1.1 =====================================Version control:unknownPlatform:Timestamp: -12-24T15:49:32ZHost: Windows 10.0.18362 AMD64CMake: 3.15.5CMake generator: MinGW MakefilesCMake build tool: D:/programing/Qt5.12.5/Tools/mingw730_64/bin/mingw32-make.exeConfiguration:ReleaseCPU/HW features:Baseline:SSE SSE2 SSE3requested: SSE3Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKXSSE4_1 (15 files): + SSSE3 SSE4_1SSE4_2 (2 files):+ SSSE3 SSE4_1 POPCNT SSE4_2FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVXAVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVXAVX2 (29 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2C/C++:Built as dynamic libs?:YESC++ Compiler:D:/programing/Qt5.12.5/Tools/mingw730_64/bin/g++.exe (ver 7.3.0)C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUGC++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUGC Compiler: D:/programing/Qt5.12.5/Tools/mingw730_64/bin/gcc.exeC flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUGC flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUGLinker flags (Release):-Wl,--gc-sections Linker flags (Debug): -Wl,--gc-sections ccache: NOPrecompiled headers: YESExtra dependencies:opengl32 glu323rdparty dependencies:OpenCV modules:To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo stitching ts video videoioDisabled:python3 python_bindings_generator python_tests worldDisabled by dependency:-Unavailable: java js python2Applications:tests perf_tests appsDocumentation:NONon-free algorithms: NOWindows RT support: NOGUI: QT:YES (ver 5.12.5)QT OpenGL support: YES (Qt5::OpenGL 5.12.5)Win32 UI:YESOpenGL support: YES (opengl32 glu32)VTK support: NOMedia I/O: ZLib: build (ver 1.2.11)JPEG: build-libjpeg-turbo (ver 2.0.2-62)WEBP: build (ver encoder: 0x020e)PNG:build (ver 1.6.37)TIFF: build (ver 42 - 4.0.10)JPEG 2000: build (ver 1.900.1)OpenEXR: build (ver 2.3.0)HDR:YESSUNRASTER: YESPXM:YESPFM:YESVideo I/O:DC1394: NOFFMPEG: YES (prebuilt binaries)avcodec: YES (58.35.100)avformat: YES (58.20.100)avutil:YES (56.22.100)swscale: YES (5.3.100)avresample:YES (4.0.0)GStreamer: NODirectShow: YESParallel framework: noneTrace:YES (built-in)Other third-party libraries:Lapack: NOEigen: NOCustom HAL: NOProtobuf:build (3.5.1)OpenCL: YES (no extra features)Include path:D:/programing/opencv/sources/3rdparty/include/opencl/1.2Link libraries: Dynamic loadPython (for build): E:/Anaconda3/envs/tensorflow/python.exeJava:ant:NOJNI:NOJava wrappers:NOJava tests: NOInstall to:D:/programing/opencv/OpenCVMinGW64/install-----------------------------------------------------------------Configuring doneGenerating done

在生成目录下打开 PowerShell 或 cmd 或 Git Bash Here,编译,安装:

D:\programing\Qt5.12.5\Tools\mingw730_64\bin\mingw32-makeD:\programing\Qt5.12.5\Tools\mingw730_64\bin\mingw32-make install

编译完成(MinGW64貌似时间挺长,可能我小破机的缘故吧):

安装完成:

最后将文件夹添加到环境变量

D:\programing\opencv\OpenCVMinGW32\install\x86\mingw\binD:\programing\opencv\OpenCVMinGW64\install\x64\mingw\bin

如果不添加在测试程序会报如下错误:

17:15:49: Starting C:\Users\HaoHao\Desktop\build-test-Desktop_Qt_5_12_5_MinGW_32_bit-Debug\debug\test.exe ...17:15:49: The program has unexpectedly finished.17:15:49: The process was ended forcefully.17:15:49: C:/Users/HaoHao/Desktop/build-test-Desktop_Qt_5_12_5_MinGW_32_bit-Debug/debug/test.exe crashed.

在 cmd 中输入ECHO %PATH%即可看见存在的环境变量

测试程序如下创建:

创建一个新项目:Qt Widgets Application

Kits 选择 MinGW 32-bit 或 MinGW 64-bit(我都测试过,可以运行,读者可以任选,或者都选)

将一张图片放入项目的同级目录下:

例如我放的 Head.jpg

开始编写程序,首先在.pro文件里加入INCLUDEPATH,LIBS,其余不用管,效果如下,我编写示例为加入 32位:

INCLUDEPATH += D:\programing\opencv\OpenCVMinGW32\install\includeLIBS += D:\programing\opencv\OpenCVMinGW32\install\x86\mingw\bin\libopencv_*d.dll

编写main.cpp,其余 cpp 文件不用管:

#include "mainwindow.h"#include <QApplication>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;int main(int argc, char *argv[]){Mat image = imread("E:\\picture\\Head.jpg");namedWindow("My Image", 1);imshow("My Image", image);waitKey(0);QApplication a(argc, argv);MainWindow w;w.show();return a.exec();}

再次确认 你选择运行的Kits是否为MinGW 32-bit

最后运行效果如下

这里有一个大坑,我在运行时出现了如下错误:

因为我将图片放在项目文件夹后,我读入图片用的:

Mat image = imread("Head.jpg");

后来我想确认图片是否被读入,编写了如下验证代码:

#include "mainwindow.h"#include <QApplication>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>#include "iostream"using namespace std;using namespace cv;int main(int argc, char *argv[]){Mat image = imread("Head.jpg");if(!image.empty())printf("exist");if(image.empty())printf("empty");cout << endl << _pgmptr << endl;QApplication a(argc, argv);MainWindow w;w.show();return a.exec();}

运行结果如下:

可以看到在下方栏的输出为:

emptyC:\Users\HaoHao\Desktop\build-test-Desktop_Qt_5_12_5_MinGW_32_bit-Debug\debug\test.exe

说明图片未被读入,并打印了工程运行时的文件夹位置,当我把图片放在工程文件夹目录下时,运行成功了

注:运行截图中的 ASSERT failure in QCoreApplication: “there should be only one application object”, file kernel\qcoreapplication.cpp, line 792 是我使用 Ctrl + Alt + A 截图时由于按了 Alt 这个按键,这个按键相当于 Qt 里的一个快捷键,所以才报 failure,直接使用电脑按键 PrtSc 则不会出现 failure 截图如下:

到此,OpenCV cmake MinGW32 与 MinGW 64 就结束了,作此记录想要生成 Release版本,同理操作,只需要修改 type 下拉选项为 Release

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。