vs2017+opencv3.4.1 Configuration

Source: Internet
Author: User
Tags win32

The article synchronizes with the Mango Hao Ming configuration OPENCV system environment variable

Configuring the environment variable is

D:\opencv\build\x86\vc15\bin    //fill in according to your own catalogue

The directory is added to the path of the system, so that the system can find the DLL within the path setting when the program is running.

Take Win10, for example. Click to go to environment variable-----Find the system variable----Locate path-> edit--Add the above table of contents directly to the search box. Other methods of entry can be entered from the Control Panel.

Bin directory Interpretation: x86 can be understood to be 32-bit, on behalf of the project debugging can only use x86. If you want to use 64-bit debugging, then add the x64 bin as well. The two system variables are separated by semicolons. Note that this does not refer to how many bits of the system are selected. VC15 represents vs2017. Vs2008=vc9,vs2010=vc10,vs2012=vc11,vs2013=vc12. VS2015 also temporarily with VC12, it seems that in opencv3 there is a Vc14 property configuration One-time configuration permanent use

Online about OpenCV Project Property Configuration Tutorial Many, the truth is the same. But some just say the method of configuration, which causes each new project to be re-equipped once, more troublesome. One configuration method is very simple, the principle is that the first configuration is not directly configure the default property page of the project, but a new property page, the configuration can be saved after completion, the next time the new project directly imported on the line. steps:

Create a new project, you can choose a console or an empty project just fine. Locate the property manager (the property manager location for each version is different, typically visible in the sidebar, or found in other Windows , such as views).

Then, find the corresponding project the current compilation debugging platform, select the corresponding folder of the property manager, right-click to add a new property page.
For example, my compilation debugging platform is debug-x86. The property manager then adds a property page to the folder where the Debug|win32 is selected.

The property page has a meaningful name, such as the information on the platform to which the property page belongs.

Then double-click the new property page to edit it.

1. Include directory configuration

Win32 or x64 in the Platform box indicates whether you want to configure a 32-bit or 64-bit compilation, and you need to change the platform to point to Configuration Manager. Select "Configuration Properties" > "VC + + directory" and add the following 3 to the "Include directory" on the right:

D:\opencv\build\include
D:\OPENCV\BUILD\INCLUDE\OPENCV
D:\opencv\build\include\opencv2

2. Library Directory Configuration

Added 1 in the Library directory:
D:\opencv\build\x86\vc15\lib
Here x86 or x64, as well as the VC version of the choice, all with the environment variable configuration said.

3. Link library Configuration

Right-click Project, Properties, configuration Properties, linker, enter, select Debug in the Configuration drop-down box. On the right side of the Additional Dependencies column point, edit to copy the following file names to the blank space:

Opencv_calib3d341d.lib
opencv_core341d.lib
opencv_dnn341d.lib
opencv_features2d341d.lib
OpenCV _flann341d.lib
opencv_highgui341d.lib
opencv_imgcodecs341d.lib
opencv_imgproc341d.lib
opencv_ Ml341d.lib
opencv_objdetect341d.lib
opencv_photo341d.lib
opencv_shape341d.lib
opencv_ Stitching341d.lib
opencv_superres341d.lib
opencv_video341d.lib
opencv_videoio341d.lib
Opencv_videostab341d.lib

Notice here that all the file names are D-terminated, corresponding to debug, which does not end with D corresponds to release. So, next select "Release" in the Configuration drop-down box and add the following file names to the additional dependencies:

Opencv_calib3d341.lib
opencv_core341.lib
opencv_dnn341.lib
opencv_features2d341.lib
OpenCV _flann341.lib
opencv_highgui341.lib
opencv_imgcodecs341.lib
opencv_imgproc341.lib
opencv_ Ml341.lib
opencv_objdetect341.lib
opencv_photo341.lib
opencv_shape341.lib
opencv_ Stitching341.lib
opencv_superres341.lib
opencv_video341.lib
opencv_videoio341.lib
opencv_ Videostab341.lib
Description, the configuration here is the opencv3.4.1 version of their own compilation, different versions of the link library configuration may not be the same file name, but the principle is the same, that is, the D:\opencv\build\x86\vc15\lib directory under the name of the copy to paste on the line, However, make a distinction between the debug version (with D) and release version (without D). For the bulk copy file name, refer to the details here

This configuration is complete, the last step is to save the configuration of the property page, to the project directory to find the newly created property page, copied and pasted into the OpenCV directory (recommended).

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.