win764 on vs2010+opencv2.4.11 installation configuration

Source: Internet
Author: User

1: Prep Work

1) OpenCV Download your desired version of the OpenCV library file, run the installation to extract a custom folder (D:\Program files).

2) Install the VS2010.

Two: Configuration

1. Computer environment variable: computer-〉 right-〉 property-〉 Advanced System design-〉 environment variable-〉 user variable-〉 find path (new one if not path,z), edit add

D:\Program Files\opencv\build\x86\vc10\bin;d:\program Files\opencv\build\x64\vc10\bin

2. VS Configuration

1) file-〉 new project-Enter name ABC

2) Toolbar: View-〉 Solution Explorer-〉 source file-〉 Right-click-〉 Add-〉 New Item->c++, enter name ABC

3) View-〉 property Manager-〉debug| Win32-> (Double-click) Microsoft.Cpp.Win32.user

--〉 Common Properties-〉vc++ directory-〉 executable directory: add: D:\Program files\opencv\build\x86\vc10\bin

4) is also in

View-〉 Property Manager-〉debug| Win32-> (Double-click) Microsoft.Cpp.Win32.user

--〉 Common Properties-〉vc++ directory-〉 contains directories-〉 add:

D:\Program Files\opencv\build\include

D:\Program FILES\OPENCV\BUILD\INCLUDE\OPENCV

D:\Program Files\opencv\build\include\opencv2

[This is the case where the OPENCV was previously decompressed to D:\Program files\. The actual path also depends on your own OPENCV extracted to which directory, according to the actual situation to adjust. ]

5) Still the same, in

View-〉 Property Manager-〉debug| Win32-> (Double-click) Microsoft.Cpp.Win32.user

--〉 Common Properties-〉vc++ Directory-Library directory add: D:\Program files\opencv\build\x86\vc10\lib

Add the path to the D:\ProgramFiles\opencv\build\x86\vc10\lib.

The question of whether to choose x86 or x64 here is a often puzzling one. Of course, for a 32-bit operating system, the x86 is definitely selected.

If it is a 64-bit operating system, many children's shoes will be taken for granted to choose x64, not actually. The correct understanding is this:

Whether you are a 32-bit or 64-bit operating system, use only the Win32 compiler or the X64 compiler.

In fact, the configuration selection is not directly related to the 64-bit or 32-bit system, but it is the compiler you use when compiling your program.


The compiler chose Win32, just use x86.

The compiler chose X64, just use X64. In general, however, the Win32 X86 compiler is used. So, whether 32 or 64-bit operating systems, the configuration file is best to choose the x86 version of the

Also, the VC10 here represents vs2010, and if it's another version of Visual Studio, tweak it a little bit.

5) configuration of the connection library

View-〉 Property Manager-〉debug| Win32-> (Double-click) Microsoft.Cpp.Win32.user

--〉 Common Properties-〉 Connector-〉 input-〉 Additional dependencies-〉 add:

The content is the name of all Lib library files under D:\Program files\opencv\build\x86\vc10\lib, of which 2411 represents our OPENCV version of 2.4.11, if the other version of the configuration is here to make the corresponding changes

Opencv_calib3d2411.lib
Opencv_calib3d2411d.lib
Opencv_contrib2411.lib
Opencv_contrib2411d.lib
Opencv_core2411.lib
Opencv_core2411d.lib
Opencv_features2d2411.lib
Opencv_features2d2411d.lib
Opencv_flann2411.lib
Opencv_flann2411d.lib
Opencv_gpu2411.lib
Opencv_gpu2411d.lib
Opencv_highgui2411.lib
Opencv_highgui2411d.lib
Opencv_imgproc2411.lib
Opencv_imgproc2411d.lib
Opencv_legacy2411.lib
Opencv_legacy2411d.lib
Opencv_ml2411.lib
Opencv_ml2411d.lib
Opencv_nonfree2411.lib
Opencv_nonfree2411d.lib
Opencv_objdetect2411.lib
Opencv_objdetect2411d.lib
Opencv_ocl2411.lib
Opencv_ocl2411d.lib
Opencv_photo2411.lib
Opencv_photo2411d.lib
Opencv_stitching2411.lib
Opencv_stitching2411d.lib
Opencv_superres2411.lib
Opencv_superres2411d.lib
Opencv_ts2411.lib
Opencv_ts2411d.lib
Opencv_video2411.lib
Opencv_video2411d.lib
Opencv_videostab2411.lib

Note that in order to avoid the case where the. dll file cannot be found by the computer, the associated DLLs are copied to the directory of the Windows operating system. If your Windows is installed on drive C, then the path is C:\Windows. These DLLs are stored in the D:\Program Files\opencv\build\x86\vc10\bin directory according to the storage environment of my OPENCV.

To this directory, "Alt+a" Select All, "Alt+c" copy, and then go to C:\Windows below, "alt+v" copy, is complete.

Third, testing

Add the following code to the previously built Abc.cpp

#include "highgui.h"
int main (int argc,char **argv)
{
Iplimage *img=cvloadimage ("pp.jpg");
Cvnamedwindow ("Example1", cv_window_autosize);
Cvshowimage ("Example1", IMG);
Cvwaitkey (0);
Cvreleaseimage (&IMG);
Cvdestroywindow ("Example1");
}

Place a picture named Pp.jpg into the project catalog

, then click the "Run" button, if the configuration is successful, will not error, get the expected results of the operation:

Questions about the test (http://zhidao.baidu.com/link?url= Akvfqol0pmtb4f8mp25aqdupaxgynsdny0beczpwye2qbmnnhtmthn8xvbkd28bdlzrmi_ 6PWEDJNVYV3NICUV8A4D0Y4N9U2K8YDTLXWCG): Show that the project is out of date, unable to start the program, the system cannot find a workaround for the file ——————

This is caused by a log file, which can be
Project \ properties \ Configuration properties \ manifest tools \ input and output \ Embed list: The original is "yes" and changed to "no".
or the
Project \ properties \ configuration properties \ linker \ manifest file \ Generate manifest: The original is "yes" and changed to "no".

And then it's OK!

[Post reference: http://www.cnblogs.com/woshitianma/p/3853447.html

http://blog.csdn.net/ningyaliuhebei/article/details/17097747

]

win764 on vs2010+opencv2.4.11 installation configuration

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: info-contact@alibabacloud.com 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.