set path=D:devIDEQt5.7.0Toolsmingw530_32in;%path% cd build_mingw530_32 cmake -G "MinGW Makefiles" -D CMAKE_CXX_COMPILER="g++.exe" -D CMAKE_C_COMPILER="gcc.exe" -D CMAKE_MAKE_PROGRAM="mingw32-make.exe" -D WITH_IPP=OFF -D WITH_OPENCL=OFF -D BUILD_TIFF=ON -D WITH_TIFF=ON -D BUILD_PNG=ON -D WITH_PNG=ON -D BUILD_ZLIB=ON -D WITH_JASPER=OFF -D WITH_OPENEXR=OFF -D BUILD_OPENEXR=OFF -D BUILD_SHARED_LIBS=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_opencv_apps=OFF -D BUILD_examples=OFF -D BUILD_opencv_datasets=OFF -D BUILD_opencv_line_descriptor=OFF -DBUILD_opencv_python=OFF -DBUILD_opencv_java=OFF ../sources mingw32-make mingw32-make install
需要修改path中qt的位置
-DBUILD_SHARED_LIBS=ON 改为OFF 编译静态库