You can change between the two using the drop-down at the top of the properties dialog.įor the debug configuration we want to add all of the libraries that have a d at the end of their name (the d stands for debug).There are a number of ways provided by Microsoft to create a setup project for windows application.īut when I started to create one, I got nothing but queries and confusions of how to start and where to start. Note that, for these settings, we will need different values for the debug and release configurations. We will be adding all of the library files within the library directory we linked in the above step. We are going to edit the Additional Dependencies entry to point to the library files. First, select the Linker –> Input section.
In my case, this is at C:\OpenCV4\圆4\vc15\lib. Set this to the lib folder, located in the directory containing your platform’s build of OpenCV. Next, we need to add the library path by editing the Library Directories entry. Once you have added the include directory just hit OK. In my case, this is at C:\OpenCV4\include. In here, click the button to add a new folder and browse for the include directory in the folder containing your OpenCV files. This will open another dialog where you can edit this setting. To do this, edit the Include Directories entry. First, we need to tell Visual Studio to include the header files for the OpenCV library. On the right-hand side, go to the VC++ Directories section. To start with, though, make sure you are set to be editing the settings for All Configurations. There are several things that we need to adjust in here. To get started, right-click on your project in the solution explorer and choose Properties. Now we’ve got a C++ project setup in Visual Studio, but we still need to tell VS where it can locate all of the OpenCV dependencies. Once you create the project you’ll be greeted with a standard, boilerplate console app. Within the new project wizard, we are going to create a Windows C++ console application.
Open up Visual Studio and go to File->New->Project. With the OpenCV files now in our Path, we are ready to start setting up the project. With that being said, I think the new interface for doing this is straightforward enough that I don’t need to go into extended details on the differences. NOTE: This is the only part that is significantly different when using Visual Studio 2019 instead of Visual Studio 2017. Once you are finished, click OK on both of those dialogs. In my case, these files are in C:\OpenCV4\圆4\vc15\bin. Within that directory, you want to find the bin folder for your architecture. In this new dialog, click the Browse… button and browse to the folder containing your OpenCV files. In the dialog that opens, double click the Path item, which will in turn open another dialog. An option should appear called Edit environment variables for your account. This will make it so we don’t have to copy any of the OpenCV DLLs into our project.įirst, open up the start menu and start typing environment variables. The first thing we are going to do is edit the PATH variable on Windows to include the directory containing our OpenCV files. Step 1: Add the OpenCV Directory to Your Path #