If the installation version is installed on a DVD and the opencv of the project application is checked during customization during the installation process, the system will bring the opencv2.2 version, but the header file cannot be found, this is a problem. If someone knows what the problem is, don't worry about it. You can use the installation package rpm to successfully install it, but still cannot find the header file ..... As a result, opencv2.3 can only be reinstalled. /configure is different, so before make, you will not check whether you have installed gtk +. This is a way to implement the cv window, all functions that use the window without its cv will fail to be called. The solution is the yum install gtk2-dev, or check gnome Desktop development on the software customization. There are a lot of installation information about opencv2.3 on the Internet.
Tar-xf OpenCV-2.3.0.tar.bz2
Cd OpenCV-2.3.0
Mkdir release
Cd release
Cmake-D CMAKE_BUILD_TYPE = RELEASE-D CMAKE_INSTALL_PREFIX =/usr/lib-D BUILD_PYTHON_SUPPORT = ON ..
Make
Make install
These steps are common and basically the same
Then, you can find the path for pkg-config in either of the following ways:/etc/ld. so. add a line/usr/local/lib to the conf file, and the second is in/etc/ld. so. conf. d. Create an opencv file in the folder. conf. The content is/usr/local/lib. Replace it with root to update ldconfig.
Next, you can set the value of PKG_CONFIG_PATH or copy the file.
How to Set Environment Variables
Export PKG_CONFIG_PATH =/usr/local/lib/pkgconfig: $ PKG_CONFIG_PATH
File copying method:
Cp/usr/local/lib/pkgconfig/opencv. pc/usr/lib/pkgconfig
Switch to the samples/cpp folder.
G ++ 'pkg-config -- cflags -- libs opencv 'Drawing. cpp-o draw
./Draw
Running correctly!
When we build the opencv environment in eclipse, although header files are included in the include folder, directly compiling is a problem, in project-> c ++ build-> setting, add 'pkg-config -- cflags opencv 'to the Miscellaneous file of c ++ complier and add 'pkg' to the same position of c ++ link. -config -- libs opencv ', this operation can be compiled and run successfully.
Note: The quotation marks are reversed.
Author: "Qingyi xuanyuan"