0% found this document useful (0 votes)
126 views

Settings: Files/Opencv Directory. Now, We Have To Configure Devcpp That He Can Take

This document provides instructions for configuring the DevC++ IDE to use the OpenCV library for C/C++ computer vision programs. The steps include: 1. Configuring the compiler options to include OpenCV header files and link libraries. 2. Adding the OpenCV include directories to the C/C++ include paths so header files can be found. 3. Specifying the library file locations so static OpenCV libraries can be linked. 4. Adding the directory containing OpenCV DLLs so programs can run with the shared library. After configuration, a sample OpenCV program from the samples folder can be built and run successfully.

Uploaded by

Lesocrate
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views

Settings: Files/Opencv Directory. Now, We Have To Configure Devcpp That He Can Take

This document provides instructions for configuring the DevC++ IDE to use the OpenCV library for C/C++ computer vision programs. The steps include: 1. Configuring the compiler options to include OpenCV header files and link libraries. 2. Adding the OpenCV include directories to the C/C++ include paths so header files can be found. 3. Specifying the library file locations so static OpenCV libraries can be linked. 4. Adding the directory containing OpenCV DLLs so programs can run with the shared library. After configuration, a sample OpenCV program from the samples folder can be built and run successfully.

Uploaded by

Lesocrate
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Settings

We will suppose that the OpenCV library is installed in the C:\Program Files\OpenCV directory. Now, we have to configure DevCpp that he can take into account, all the includes files (.h), all the static libraries in OpenCV (.lib), and all the dynamic library (.dll) useful for the execution and not for the compilation. This configuration has been tested with the version 4.9.9.x of DevCPP. First of all, you have to indicate the header files you want to add. To do that, select Tools->Compiler Options.

. Then click on the plus sign to add a new compiler (in fact, only some different options) named here, OpenCV.

To finish, on the section Add the following ... write : -L"C:\Program Files\OpenCV\lib" -lcxcore -lcv -lcvaux -lhighgui -lml -lcvcam. Or the following for OpenCV 2.1 -L"C:\OpenCV2.1\lib" -lcxcore210 -lcv210 lcvaux210 -lhighgui210 -lml210

Include files configuration


Next, click on Directories and then on C Includes to add all the headers, located in some C:\Program Files\OpenCV subdirectories as shown in the picture. For OpenCV2.x, you will notice that there are changes in the overall directory structure and hence you won't find the folders shown in the image below. You only need to add C:\Program Files\OpenCV2.x\include\opencv in the include tab to get things to work. Of course, if you want to write C++ programs, do the same thing on the C++ Includes tab.

Static library files configuration


The following picture shows the static libraries paths to add.For OpenCV2.x there is no otherlibs\highgui folder and hence just adding C:\Program

FIles\OpenCV2.x\bin is sufficient.

Dynamic library files configuration

And to finish, add the bin directory where the dlls are:

Test
Let us choice a C program on the samples directory of OpenCV and try to execute it by typing F9. As you can see, all is OK.

You might also like