Google
 

6/8/07

compile cpp with opencv.

In order to use opencv, when you compile the program you need to use the following:
g++ `pkg-config --cflags opencv` -o test test.cpp `pkg-config --libs opencv`
Or you can execute the commands to get the parameters used.
> pkg-config --cflags opencv
-I/usr/local/include/opencv
> pkg-config --libs opencv
-L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml
Now you can use something similar to the following:
> g++ -I/usr/local/include/opencv -o test opencv_test.cpp -L/usr/local/lib/ -lcxcore -lhighgui -lm