Rohit Rohela
Rohit Rohela

Reputation: 422

Eclipse CDT not working with OpenCV 2.0 integrated with Cygwin compiler

I have done all the necessary job like adding "c:/cygwin/bin" to system path, I have also set the include path under project->properties->c/c++ build->setting and also set the linker library search path.
Now when I include file like #include"cv.h", it gives no error, but when I run the program error comes like

undefined reference to '_cvGetSize'

I have included the necessary files, and read lots of tutorials that are available but still I couldn't able to run my code, please help me

Upvotes: 0

Views: 587

Answers (1)

karlphillip
karlphillip

Reputation: 93410

I always recommend that before jumping to an IDE you make sure your system is installed and configured correctly by attempting to compile an application on the cmd-line:

g++ flann.cpp -o flann `pkg-config --cflags --libs opencv`

or:

g++ flann.cpp -o flann -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

Apparently you didn't link your project with the opencv libraries, which is being achieved in the cmd above with: -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann.

That missing symbol is defined in one of these libraries.

Upvotes: 2

Related Questions