How to get opencv to enable work in kubuntu? (Includes a decision on how to enable and link in netbeans 6.7.1)

I installed the OpenCV C libraries from package management in my Kubuntu 9.10. I wrote a small image modification program that uses these libraries, but I can’t compile it, because every time I try to compile, I get an error that the functions from the OpenCV library could not be found.

These header files are in the folder /usr/include/opencv/, but still the compiler says that the functions cannot be found.

I tried to enable them using basic

#include <highgui.h>
#include <cv.h>

in netbeans (and I installed netbeans to search for header files from this particular directory), and also tried to include them with the full path.

#include </usr/include/opencv/highgui.h>
#include </usr/include/opencv/cv.h>

( ), , .

Edit:

, ,

undefined reference to 'function_name'

, opencv.

, ?


II:

- netbeans 6.7.1 , , :

, opencv .

  • Netbeans, : → → C/++ → → Include ( /usr/local/include/opencv )
  • , : → → → C/++ → :/usr/local/include/opencv
  • → → → → :/usr/local/include/opencv : -I/usr/local/include/opencv -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml

!!

+3
2

"undefined " . OpenCV. , cv highgui (-lcv -lhighgui) pkg-config, . .

+1

OpenCV pkg-config, unix. (untested):

make CFLAGS="$(pkg-config --cflags --libs opencv)" your-program
0

Source: https://habr.com/ru/post/1729817/


All Articles