3P_LIBRARY_OUTPUT_PATH=E:/opencv451/newbuild32/3rdparty/lib
ANT_DIR_ENV_PATH=
ANT_EXECUTABLE=ANT_EXECUTABLE-NOTFOUND
ANT_NAME=ant.bat
ARGC=3
ARGN=;TOFILE;CMakeVars.txt
ARGV=;TOFILE;CMakeVars.txt
ARGV0=
ARGV1=TOFILE
ARGV2=CMakeVars.txt
BLAS_Accelerate_LIBRARY=BLAS_Accelerate_LIBRARY-NOTFOUND
BLAS_FOUND=FALSE
BLAS_LIBRARIES=FALSE
BLAS_SEARCH_LIBS=mkl_intel_c libiomp5md mkl_intel_thread mkl_core;mkl_intel_c libguide40 mkl_intel_thread mkl_core;mkl_intel_c libiomp5md mkl_intel_thread mkl_core;mkl_intel_c mkl_sequential mkl_core;mkl_intel_lp64 libiomp5md mkl_intel_thread mkl_core;mkl_intel_lp64 libguide40 mkl_intel_thread mkl_core;mkl_intel_lp64 libiomp5md mkl_intel_thread mkl_core;mkl_intel_lp64 mkl_sequential mkl_core;mkl_rt
BLAS_SEARCH_LIBS_WIN_MAIN=mkl_intel_c;mkl_intel_lp64
BLAS_SEARCH_LIBS_WIN_THREAD=libiomp5md mkl_intel_thread;libguide40 mkl_intel_thread;libiomp5md mkl_intel_thread;mkl_sequential
BLAS_WORKS=
BLAS_acml_LIBRARY=BLAS_acml_LIBRARY-NOTFOUND
BLAS_acml_mp_LIBRARY=BLAS_acml_mp_LIBRARY-NOTFOUND
BLAS_armpl_lp64_LIBRARY=BLAS_armpl_lp64_LIBRARY-NOTFOUND
BLAS_blas_LIBRARY=BLAS_blas_LIBRARY-NOTFOUND
BLAS_blis_LIBRARY=BLAS_blis_LIBRARY-NOTFOUND
BLAS_complib_sgimath_LIBRARY=BLAS_complib_sgimath_LIBRARY-NOTFOUND
BLAS_cxml_LIBRARY=BLAS_cxml_LIBRARY-NOTFOUND
BLAS_dxml_LIBRARY=BLAS_dxml_LIBRARY-NOTFOUND
BLAS_eml_LIBRARY=BLAS_eml_LIBRARY-NOTFOUND
BLAS_essl_LIBRARY=BLAS_essl_LIBRARY-NOTFOUND
BLAS_fjlapack_LIBRARY=BLAS_fjlapack_LIBRARY-NOTFOUND
BLAS_flexiblas_LIBRARY=BLAS_flexiblas_LIBRARY-NOTFOUND
BLAS_goto2_LIBRARY=BLAS_goto2_LIBRARY-NOTFOUND
BLAS_mkl_SEARCH_SYMBOL=sgemm
BLAS_mkl_intel_c_LIBRARY=BLAS_mkl_intel_c_LIBRARY-NOTFOUND
BLAS_mkl_intel_lp64_LIBRARY=BLAS_mkl_intel_lp64_LIBRARY-NOTFOUND
BLAS_mkl_rt_LIBRARY=BLAS_mkl_rt_LIBRARY-NOTFOUND
BLAS_openblas_LIBRARY=BLAS_openblas_LIBRARY-NOTFOUND
BLAS_scs_LIBRARY=BLAS_scs_LIBRARY-NOTFOUND
BLAS_sgemm_LIBRARY=BLAS_sgemm_LIBRARY-NOTFOUND
BLAS_sunperf_LIBRARY=BLAS_sunperf_LIBRARY-NOTFOUND
BLAS_vecLib_LIBRARY=BLAS_vecLib_LIBRARY-NOTFOUND
BLA_STATIC=1
BLA_VENDOR=All
BUILD_CUDA_STUBS=OFF
BUILD_DOCS=OFF
BUILD_EXAMPLES=OFF
BUILD_IPP_IW=OFF
BUILD_ITT=OFF
BUILD_JASPER=ON
BUILD_JAVA=ON
BUILD_JPEG=ON
BUILD_LIST=
BUILD_OPENEXR=ON
BUILD_OPENJPEG=ON
BUILD_PACKAGE=ON
BUILD_PERF_TESTS=ON
BUILD_PNG=ON
BUILD_PROTOBUF=ON
BUILD_SHARED_LIBS=ON
BUILD_TBB=OFF
BUILD_TESTS=ON
BUILD_TIFF=ON
BUILD_USE_SYMLINKS=OFF
BUILD_WEBP=ON
BUILD_WITH_DEBUG_INFO=OFF
BUILD_WITH_DYNAMIC_IPP=OFF
BUILD_ZLIB=ON
BUILD_opencv_apps=ON
BUILD_opencv_calib3d=ON
BUILD_opencv_core=ON
BUILD_opencv_dnn=ON
BUILD_opencv_features2d=ON
BUILD_opencv_flann=ON
BUILD_opencv_gapi=ON
BUILD_opencv_highgui=ON
BUILD_opencv_imgcodecs=ON
BUILD_opencv_imgproc=ON
BUILD_opencv_java_bindings_generator=ON
BUILD_opencv_js=OFF
BUILD_opencv_js_bindings_generator=ON
BUILD_opencv_ml=ON
BUILD_opencv_objc_bindings_generator=ON
BUILD_opencv_objdetect=ON
BUILD_opencv_photo=ON
BUILD_opencv_python_bindings_generator=ON
BUILD_opencv_python_tests=ON
BUILD_opencv_stitching=ON
BUILD_opencv_ts=ON
BUILD_opencv_video=ON
BUILD_opencv_videoio=ON
BUILD_opencv_world=OFF
CACHED_CPU_BASELINE_FLAGS= -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 -Wsuggest-override -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
CACHED_CPU_DISPATCH_AVX_FLAGS= -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 -Wsuggest-override -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 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx
CACHED_CPU_DISPATCH_FP16_FLAGS= -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 -Wsuggest-override -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 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mf16c -mavx
CACHED_CPU_DISPATCH_SSE4_1_FLAGS= -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 -Wsuggest-override -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 -msse3 -mssse3 -msse4.1
CACHED_CPU_DISPATCH_SSE4_2_FLAGS= -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 -Wsuggest-override -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 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2
CAN_BUILD_ANDROID_PROJECTS=FALSE
CLAMDBLAS_INCLUDE_DIR=CLAMDBLAS_INCLUDE_DIR-NOTFOUND
CLAMDBLAS_ROOT_DIR=CLAMDBLAS_ROOT_DIR-NOTFOUND
CLAMDFFT_INCLUDE_DIR=CLAMDFFT_INCLUDE_DIR-NOTFOUND
CLAMDFFT_ROOT_DIR=CLAMDFFT_ROOT_DIR-NOTFOUND
CMAKE_ADDR2LINE=D:/Qt/Qt5.14.1/Tools/mingw730_32/bin/addr2line.exe
CMAKE_AR=D:/Qt/Qt5.14.1/Tools/mingw730_32/bin/ar.exe
CMAKE_AR=D:/Qt/Qt5.14.1/Tools/mingw730_32/bin/ar.exe
CMAKE_AUTOGEN_ORIGIN_DEPENDS=ON
CMAKE_AUTOMOC_COMPILER_PREDEFINES=ON
CMAKE_AUTOMOC_MACRO_NAMES=Q_OBJECT;Q_GADGET;Q_NAMESPACE;Q_NAMESPACE_EXPORT
CMAKE_AUTOMOC_PATH_PREFIX=OFF
CMAKE_BASE_NAME=gcc
CMAKE_BINARY_DIR=E:/opencv451/newbuild32
CMAKE_BUILD_TOOL=D:/Qt/Qt5.14.1/Tools/mingw730_32/bin/mingw32-make.exe
CMAKE_BUILD_TYPE=Release
CMAKE_BUILD_TYPE=Release
CMAKE_C11_COMPILE_FEATURES=c_std_11;c_static_assert
CMAKE_C11_EXTENSION_COMPILE_OPTION=-std=gnu11
CMAKE_C11_STANDARD_COMPILE_OPTION=-std=c11
CMAKE_C11_STANDARD__HAS_FULL_SUPPORT=ON
CMAKE_C17_COMPILE_FEATURES=
CMAKE_C23_COMPILE_FEATURES=
CMAKE_C90_COMPILE_FEATURES=c_std_90;c_function_prototypes
CMAKE_C90_EXTENSION_COMPILE_OPTION=-std=gnu90
CMAKE_C90_STANDARD_COMPILE_OPTION=-std=c90
CMAKE_C90_STANDARD__HAS_FULL_SUPPORT=ON
CMAKE_C99_COMPILE_FEATURES=c_std_99;c_restrict;c_variadic_macros
CMAKE_C99_EXTENSION_COMPILE_OPTION=-std=gnu99
CMAKE_C99_STANDARD_COMPILE_OPTION=-std=c99
CMAKE_C99_STANDARD__HAS_FULL_SUPPORT=ON
CMAKE_CACHEFILE_DIR=e:/opencv451/newbuild32
CMAKE_CACHE_MAJOR_VERSION=3
CMAKE_CACHE_MINOR_VERSION=24
CMAKE_CACHE_PATCH_VERSION=1
CMAKE_CFG_INTDIR=.
CMAKE_COLOR_MAKEFILE=ON
CMAKE_COMMAND=D:/CMake/bin/cmake.exe
CMAKE_COMPILER_IS_GNUCC=1
CMAKE_COMPILER_IS_GNUCXX=1
CMAKE_CONFIGURATION_TYPES=Debug;Release
CMAKE_CPACK_COMMAND=D:/CMake/bin/cpack.exe
CMAKE_CROSSCOMPILING=FALSE
CMAKE_CTEST_COMMAND=D:/CMake/bin/ctest.exe
CMAKE_CURRENT_BINARY_DIR=E:/opencv451/newbuild32
CMAKE_CURRENT_FUNCTION=ocv_cmake_dump_vars
CMAKE_CURRENT_FUNCTION_LIST_DIR=E:/opencv451/opencvSource/cmake
CMAKE_CURRENT_FUNCTION_LIST_FILE=E:/opencv451/opencvSource/cmake/OpenCVUtils.cmake
CMAKE_CURRENT_FUNCTION_LIST_LINE=8
CMAKE_CURRENT_LIST_DIR=E:/opencv451/opencvSource
CMAKE_CURRENT_LIST_FILE=E:/opencv451/opencvSource/CMakeLists.txt
CMAKE_CURRENT_SOURCE_DIR=E:/opencv451/opencvSource
CMAKE_CXX11_COMP
windows+QT5.14.1-MinGW-32bit+opencv4.5.1+CMake3.24编译配置Qt使用opencv
需积分: 0 149 浏览量
更新于2023-06-25
收藏 101.5MB 7Z 举报
在本文中,我们将深入探讨如何在Windows环境下,利用QT 5.14.1 MinGW 32位版本,结合OpenCV 4.5.1和CMake 3.24来配置和编译项目,以便在Qt环境中有效使用OpenCV库。这个过程涉及到多个步骤,包括安装必要的软件、配置环境变量、构建OpenCV库以及最后在Qt Creator中创建和运行项目。让我们逐一了解这些步骤。
你需要确保已经安装了以下组件:
1. **Microsoft Windows**: 这是我们的操作系统平台。
2. **MinGW**: Minimalist GNU for Windows,是用于Windows上的GCC编译器套件,它允许我们编译QT和OpenCV的源代码。
3. **QT 5.14.1**: 这是一个跨平台的应用程序开发框架,提供了一组强大的工具和库,用于创建图形用户界面和其他类型的应用程序。
4. **OpenCV 4.5.1**: 开源计算机视觉库,包含了大量图像处理和计算机视觉的算法。
5. **CMake 3.24**: 一个跨平台的自动化构建系统,用于管理项目的构建过程。
**安装与配置步骤**:
1. **安装MinGW**: 下载并安装MinGW,确保包含g++编译器。
2. **安装QT**: 访问QT官网下载并安装QT 5.14.1 MinGW 32位版本,安装过程中记得勾选开发者工具(如qmake等)。
3. **安装CMake**: 安装CMake 3.24,用于构建和配置OpenCV库。
4. **获取OpenCV源码**: 从OpenCV官方网站或GitHub仓库下载OpenCV 4.5.1的源代码。
5. **解压OpenCV源码**: 将下载的zip文件解压到一个合适的目录。
**配置OpenCV**:
1. **配置CMake**: 打开CMake,设置源代码目录为OpenCV的解压路径,设置构建目录(例如新建一个“newbuild32”目录)。
2. **配置编译选项**: 在CMake中,设置编译器为MinGW的g++,并选择QT支持,确保`WITH_QT`选项被勾选。
3. **生成项目文件**: 点击“Configure”进行配置,然后“Generate”生成Makefile文件。
4. **编译OpenCV**: 在生成的“newbuild32”目录下,使用MinGW的mingw32-make命令编译OpenCV库。编译完成后,OpenCV的库文件会生成在这个目录中。
**配置环境变量**:
1. **添加库路径**: 将OpenCV的库文件路径(如“newbuild32/install/x86/mingw/lib”)添加到系统的PATH环境变量中。
2. **添加头文件路径**: 将OpenCV的头文件路径(如“newbuild32/install/x86/mingw/include/opencv4”)添加到系统头文件搜索路径中。
**在Qt中使用OpenCV**:
1. **新建Qt项目**: 打开Qt Creator,创建一个新的Qt Console Application项目。
2. **添加OpenCV模块**: 在.pro文件中,通过`win32:LIBS += -L$$PWD/../../../newbuild32/install/x86/mingw/lib -lopencv_core -lopencv_imgproc ...`(根据你的OpenCV库文件实际位置调整路径)添加所需的OpenCV库链接。
3. **包含头文件**: 在源代码中,通过`#include <opencv2/opencv.hpp>`引入OpenCV库。
4. **编写代码**: 使用OpenCV函数进行图像处理或计算机视觉操作。
5. **编译运行**: 在Qt Creator中编译并运行项目,如果一切配置正确,你的应用程序应能正常调用OpenCV的功能。
以上就是使用QT 5.14.1 MinGW 32位版本和OpenCV 4.5.1在Windows上进行编译配置的详细步骤。这个过程可能需要一些时间,特别是编译OpenCV库时,但是一旦完成,你就可以在Qt中充分利用OpenCV的强大功能。记住,遇到任何问题时,检查配置和路径是否正确,并参考官方文档或社区资源寻求帮助。
ZRLAB
- 粉丝: 1
- 资源: 1
最新资源
- 基于Java开发的日程管理FlexTime应用设计源码
- SM2258XT-BGA144-4BGA180-6L-R1019 三星KLUCG4J1CB B0B1颗粒开盘工具 , EC, 3A, 94, 43, A4, CA 七彩虹SL300这个固件有用
- GJB 5236-2004 军用软件质量度量
- 30天开发操作系统 第 8 天 - 鼠标控制与切换32模式
- spice vd interface接口
- 安装Git时遇到找不到`/dev/null`的问题
- 标量(scalar)、向量(vector)、矩阵(matrix)、数组(array)等概念的深入理解与运用
- 数值计算复习内容,涵盖多种方法,内容为gpt生成
- 标量(scalar)、向量(vector)、矩阵(matrix)、数组(array)等概念的深入理解与运用
- 网络综合项目实验12.19