I also have a computer in my house, but the division of work between this computer and the company's computer is very clear, this computer is dedicated to playing Warcraft, online chat, watching movies and other matters. But sometimes it gets itchy. I just want to write code. What should I do? Is it necessary to install Visual Studio Express? Don't install heavyweight tools! I found it great to install a QT creator.
However, all of them have one! Recently I have been playing opencv (download opencv2.0.1). What should I do?
After checking on the Internet, we are sure to compile opencv to use cmake to locate the post. The original post is as follows:
=== Micro split line ====
Use the opencv library in QT creator (compiled successfully in Windows 7)
Compile opencv2.0
1. download and install the tdm-mingw-1.908.0-4.4.1-2. After installation, add the bin to the system path.
2. Install opencv2.0 for Windows
3. Install cmake
4. Open cmake, configure the source code and target path, and select mingw makefiles to generate the target makefile.
5. Go to the set target path and make until all libraries are generated.
Configure QT creator
A program developed by QT generally uses qmake to generate a MAKEFILE file. Since qmake cannot identify spaces when parsing paths, it is necessary to ensure that the installation path of opencv cannot contain spaces (C:/program files/opencv is not acceptable ).
Add the following statement to the project when creating the project file (hello. Pro, Suffix: Pro:
Export depath + = D:/QT/OpenCV-2.0.0/include/opencv
Libbs + = D:/QT/OpenCV-2.0.0/lib/libcv200.dll./
D:/QT/OpenCV-2.0.0/lib/libcxcore200.dll./
D:/QT/OpenCV-2.0.0/lib/libml200.dll./
D:/QT/OpenCV-2.0.0/lib/libcvaux200.dll./
D:/QT/OpenCV-2.0.0/lib/libhighgui200.dll.
In this way, opencv 2.0 can be used in QT.
=== Micro split line ====
This post basically didn't talk about how to compile, just how to use it. Really unreliable!
I decided to look at the need for tdm-mingw-1.908.0-4.4.1-2, brother can not, to do so complex?
Of course not. Isn't QT creator a compiler? Well, use this compiler. I don't want to download anything except cmake ~~
Open cmake and try it. You cannot complete configure! The reason is that cmake_make_program is not found. This is simple. Change the value to D:/QT/2010.04/mingw/bin ).
Continue Configure. What else is an error? A bunch of DLL files cannot be found !!
Okay, I will directly put D:/QT/2010.04/mingw/bin in the environment variable.
Delete catch will be used again later. This is good. You don't need to change the cmake_make_program and it will be found automatically. Configure is successful.
Then generate it.
Run the mingw-make32 In the compiled directory, compiled through !!
This article is not a dummies tutorial! Basically you need to understand cmake and mingw-make32!
Individual records, that's all. I hope it will help you !!