Machine Vision Series 3: VS2019 OpenCV Environment Configuration

Series Article Directory

Chapter 1: Visual Studio 2019 Dynamic Link Library DLL Establishment

Chapter Two: VS Dynamic Link Library DLL Debugging

Chapter 3: VS2019 OpenCV Environment Configuration


Table of contents

Series Article Directory

foreword

1. OpenCV download?

2. Environment variable settings

3. VS project property configuration

1. Property Manager

2. Configuration attribute table

2.1 VC++ directory

 2.2 Linker - Input

3. New project load property file

Summarize


foreword

Environment: visual studio 2019; OpenCV4.5.5


1. OpenCV download?

Official Website——Library——Releases——Download the corresponding version Sources, and then install

Home - OpenCV

2. Environment variable settings

My Computer - Properties - Advanced System Settings - Environment Variables - Path - OpenCV Path

E:\Program Files (x86)\env\opencv4_5_5\build\x64\vc15\bin

 If you do not set the environment variable, you need to put the corresponding DLL in the compilation path of the solution, and directly add the environment variable regardless of the release suggestion.

Copy the .dll in the path opencv4_5_5\build\x64\vc15\bin to the Debug directory

3. VS project property configuration

1. Property Manager

Configured with the property manager, a .props file will be generated, and the next new project can be imported directly without reconfiguration.

View - Properties window, open the property manager, right-click Debug or Release to add a new project property sheet

Set the file name and save address, and the next project can add the existing property sheet and use it directly.

2. Configuration attribute table

2.1 VC++ directory

Include directory - add include and include\opencv2 in the OpenCV installation path

Library directory - x64\vc15\lib in the OpenCV installation directory

 2.2 Linker - Input

Additional dependencies - written to .lib files in x64\vc15\lib

(Note: Do not put both Debug and Release in OpenCV4 at the same time, it will report an error Debug——opencv_world455d.lib)

3. New project load property file

In the property manager, right-click in the corresponding mode to add an existing property sheet. Property Manager - Debug - Add Existing Property Sheet


Summarize

Property Manager can manage property files. No need to reconfigure every project

Guess you like

Origin blog.csdn.net/weixin_42748604/article/details/122684968