Download CMake 2.8.2

Download OpenCV 2.4.11

Download Qt 5.4

Highly improtant note: The installation directory should not contain any space or non-English character, otherwise weird error would happen when building. 

 

Open CMake 2.8.2, set the source and build directory:

Qt 5.4 OpenCV 2.4.11 Win 32 Configuration

 

Click "Configure", choose "MinGW Makefiles" and "Specify native compliers"

Qt 5.4 OpenCV 2.4.11 Win 32 Configuration

 

Set the C and C++ compiler from the Qt SDK

Qt 5.4 OpenCV 2.4.11 Win 32 Configuration

Don't forget to add the following to the system path:

C:\Qt\5.4\mingw491_32\bin

C:\Qt\Tools\mingw491_32\bin

 

Then click "Configure" and "Generate", then open cmd and go the build directory, and run "mingw32-make"

Highly important: You need to select "With_Qt" before click "Generate"!

 

When it is done, then run "mingw32-make install" and hit enter again

 

Use Qt Creator creates a new project, add following in the .pro file:

 

# Add OpenCV
INCLUDEPATH += C:\opencv\mingw\install\include
INCLUDEPATH += C:\opencv\mingw\install\include\opencv
INCLUDEPATH += C:\opencv\mingw\install\include\opencv2

LIBS += -LC:\\opencv\\mingw\\bin \
    libopencv_core2411 \
    libopencv_highgui2411 \
    libopencv_imgproc2411 \
    libopencv_features2d2411 \
    libopencv_calib3d2411 \

 

相关文章:

  • 2022-12-23
  • 2022-02-19
  • 2022-12-23
  • 2021-11-27
  • 2021-05-16
  • 2021-11-26
  • 2021-09-21
  • 2022-01-22
猜你喜欢
  • 2021-11-21
  • 2021-05-25
  • 2021-08-03
  • 2022-01-25
  • 2021-09-25
  • 2022-02-08
相关资源
相似解决方案