Configuring the QT 5.8+OPENCV 3.1.0 development environment under Windows

Source: Internet
Author: User

Recently need to transplant the program into Windows system, the program has been written, but did not expect to build a development environment but wasted so much effort

In order to prevent later re-installation of the system will not be dumbfounded, decided to set the environment to record the process, but also hope to help people who meet the same problem

All right, no more nonsense.

First, give me something to download.

(1) Qt Creator (I am using the version is 5.8)

(2) OpenCV use is OpenCV 3.1.0) PS: Do not make a mistake, to the Windows version of the

(3) CMake (dozens of trillion things under a morning, huh hehe)

(4) VS2013 this directly from the Internet to find the address download it, I use the professional version of the other version did not try to PS: I heard that the free version of the configuration can not be the environment, I believe you can solve the next Professional edition, Baidu secret ... Key (hehe)

All right, after downloading these, we'll start with the VS2013 installation. OK, NEXT, I accept and then install complete

Also install QT Creator all the way OK and then fix

Note: I configured QT to use MSVC instead of MinGW

Run OpenCV extract to any directory

Open CMake and compile OpenCV with CMake. Configure the source path and the target path of the build

(1) Source path: To select the folder containing the following files in the OPENCV installation directory

(2) Target path: can be set freely

Click the Configure Configuration button. Select (as shown) in the popup dialog box, the remaining options remain default, click the Finish button to start compiling

CMake compile End Interface For example, check the list of With_opengl and WITH_QT two, the other items should not be changed

Click the Configure button again and the red disappears

Click the Generate button to generate the makefile file, after success, you will be prompted generating done at the bottom.

Go to the target path you just set, open the All_build file with VS2013

Right-click Allbuil build, then right-click Install build

Below start to configure the Qt creator OPENCV development environment, copy the following three folders under the same folder (only these three directories, the rest of the generated files and folders can be deleted to save disk space) ()

(1) Build/include directory under the OPENCV installation directory (that is, the directory where Opencv-3.1.0.exe was extracted)

(2) CMake the Lib file and bin file in the target directory

And put it together, like this.

Then configure the environment variables

Add C:\Release\bin to the system variable path


Then write in the QT project's. Pro file

And then write a program to test it.

Last note: After changing the contents of the. Pro file, click Build, execute qmake to update the parameters

Configuring the QT 5.8+OPENCV 3.1.0 development environment under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.