problem with sample program on Ubuntu 11.10

214 views
Skip to first unread message

Steffen

unread,
Nov 15, 2011, 11:44:43 AM11/15/11
to cvBlob
Hi, I'm new to linux, and need a bit of help. I need to use openCV
with cvBlob on linux, so installed openCV with these commands:

$ sudo add-apt-repository ppa:gijzelaar/opencv2

$ sudo apt-get install libcv2.1 libcv-dev libcvaux2.1 libcvaux-dev
libhighgui2.1 libhighgui-dev opencv-doc python-opencv

$ export LD_LIBRARY_PATH=/home/opencv/lib

$ export PKG_CONFIG_PATH=/home/opencv/lib/pkgconfig

$ pkg-config --cflags opencv

-I/usr/include/opencv

$ pkg-config --libs opencv

-lcxcore -lcv -lhighgui -lcvaux -lml

and followed by installing cvBlob to /home/steffen/SDK/cvBlob. I
compiled it with:

$ cmake-gui

set source til /home/steffen/SDK/cvBlob

set build til /home/steffen/SDK/cvBlob/bin

set openCV_DIR til /usr/include/opencv

configured and generated.

$ cd /bin

$ sudo make install

all seemed to install correctly.

I then tried compiling the sample project (/cvBlob/sample) with:

$ make

which gave a LOT of errors, and then with:

$ g++ red_object_tracking.cpp -o sample pkg-config --cflags --libs
opencv

which returned the following:

/tmp/ccRtslPR.o:
In function `main':
red_object_tracking.cpp:(.text+0x37c): undefined reference to
`cvLabel'
red_object_tracking.cpp:(.text+0x39d): undefined reference to
`cvFilterByArea'
red_object_tracking.cpp:(.text+0x3ce): undefined reference to
`cvRenderBlobs'
red_object_tracking.cpp:(.text+0x400): undefined reference to
`cvUpdateTracks'
red_object_tracking.cpp:(.text+0x444): undefined reference to
`cvRenderTracks'
red_object_tracking.cpp:(.text+0x5e1): undefined reference to
`cvSaveImageBlob'
collect2: ld returned 1 exit status

can anyone tell me what I did wrong, and how to fix this?
Hope you can help!
- Steffen

Osman Eralp

unread,
Nov 16, 2011, 10:32:19 AM11/16/11
to cvBlob

>
> $ g++ red_object_tracking.cpp -o sample pkg-config --cflags --libs
>

pkg-config is a command, so you need to surround it with the back tick
mark. Try this:

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

--Osman
Reply all
Reply to author
Forward
0 new messages