If you have installed the OpenCV library on your machine to /usr/local then you can follow this setup. Otherwise you will have to change how you link to OpenCV appropriately. This section also relates to the setup of gtkmm and fftw. If you do not want to use them, remove their sections.
1) Right click on your project and go to Properties
2) Go to the C/C++ Build section and then Settings
3) Under GCC C++ Compiler, click on Directories
4) Add the following paths under Include Paths
/usr/local/include/opencv /usr/lib/gtkmm-2.4 /usr/include/gtkmm-2.4
5) Under GCC C++ Compiler, click on Optimization
6) Add the following under Other optimization flags
-ggdb `pkg-config opencv --cflags --libs` `pkg-config gtkmm-2.4 --cflags --libs`
7) Under GCC C++ Linker, click on Libraries
8) Add the following under Libraries
cv gtkmm-2.4 highgui fftw39) Add the following under Library search path
/usr/local/lib /usr/lib
Thanks for writing this tutorial. I have been dreading the thought of having to re-setup eclipse to work with opencv. This should make things a little easier
ReplyDelete