Professional Documents
Culture Documents
.
Then click on the plus sign to add a new compiler (in fact, only some different
options) named here, OpenCV.
FIles\OpenCV2.x\bin is sufficient.
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 need to setup the PKG_CONFIG_PATH variable. For example (assuming you
are using a sh-based shell, like bash or zsh):
cd/where/you/have/the/source/code
PKG_CONFIG_PATH=/where/you/have/installed/opencv/lib/pkgconfig:$
{PKG_CONFIG_PATH}
exportPKG_CONFIG_PATH
The best way is to use pkg-config. Just define the correct PKG_CONFIG_PATH:
PKG_CONFIG_PATH=/where/you/have/installed/opencv/lib/pkgconfig:$
{PKG_CONFIG_PATH}
exportPKG_CONFIG_PATH
gccI/where/you/have/installed/opencv
L/where/you/have/installed/opencvlcvlhighguilstdc++\
omyopencvprgmmyopencvprgm.c
How to compile OpenCV with some libraries not in standard path on Linux?
The solution is to use the CFLAGS, CPPFLAGS and LDFLAGS environment variables at
configure time. For example, if you have ffmpeg library in one of your own
directories, you can do (all on one command line):
./configureCFLAGS=I/where/is/ffmpeg/includeCPPFLAGS=
I/where/is/ffmpeg/includeLDFLAGS=L/where/is/ffmpeg/lib
If an error occurs that 'a library cannot be found' during compilation on Fedora
systems:
o
Or, add the location of the OpenCV libraries to your LD_LIBRARY_PATH (should
work on most systems including Fedora)
For additional help on FFMpeg compilation: http://freeshells.ch/~phoenix/ocv.htm