compiling Opencv and cvBlob libraries in Raspbian Wheezy OS. Getting undefined references error

asked 2015-11-05 11:12:18 -0500

pradeep_kb gravatar image

updated 2015-11-05 11:24:22 -0500

berak gravatar image
pi@raspberrypi ~ $ g++ CarMotionTwoLines-HSV.cpp

CarMotionTwoLines-HSV.cpp: In constructor ‘CarVideoHandler::CarVideoHandler()’:
CarMotionTwoLines-HSV.cpp:92:17: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
CarMotionTwoLines-HSV.cpp:93:14: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
CarMotionTwoLines-HSV.cpp:94:14: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
CarMotionTwoLines-HSV.cpp:95:17: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
CarMotionTwoLines-HSV.cpp:98:15: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
CarMotionTwoLines-HSV.cpp:99:15: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/tmp/cclicE4h.o: In function `allocateOnDemand(_IplImage**, CvSize, int, int)':
CarMotionTwoLines-HSV.cpp:(.text+0x380): undefined reference to `cvCreateImage'
/tmp/cclicE4h.o: In function `resizeImg(_IplImage*, int)':
CarMotionTwoLines-HSV.cpp:(.text+0x4e0): undefined reference to `cvResize'
/tmp/cclicE4h.o: In function `resizeImgColor(_IplImage*, int)':
CarMotionTwoLines-HSV.cpp:(.text+0x5a8): undefined reference to `cvResize'
/tmp/cclicE4h.o: In function `MorfologiaDE(_IplImage*, _IplImage*, int)':
CarMotionTwoLines-HSV.cpp:(.text+0x628): undefined reference to `cvCreateStructuringElementEx'
CarMotionTwoLines-HSV.cpp:(.text+0x648): undefined reference to `cvDilate'
CarMotionTwoLines-HSV.cpp:(.text+0x660): undefined reference to `cvErode'
CarMotionTwoLines-HSV.cpp:(.text+0x66c): undefined reference to `cvReleaseStructuringElement'
/tmp/cclicE4h.o: In function `mouseHandler(int, int, int, int, void*)':
CarMotionTwoLines-HSV.cpp:(.text+0x1178): undefined reference to `cvCloneImage'
CarMotionTwoLines-HSV.cpp:(.text+0x1278): undefined reference to `cvRectangle'
CarMotionTwoLines-HSV.cpp:(.text+0x148c): undefined reference to `cvLine'
CarMotionTwoLines-HSV.cpp:(.text+0x14e0): undefined reference to `cvShowImage'
/tmp/cclicE4h.o: In function `idTrackCarPerson(_IplImage*, int**, std::_Rb_tree_const_iterator<std::pair<unsigned int const, cvb::CvBlob*> >, std::_Rb_tree_const_iterator<std::pair<unsigned int const, cvb::CvTrack*> >, int, double, double, double, CvFont, char*, int**, int**, int**, int**, int&, int&, int*, int*, int*, int*, int*, int, int, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
CarMotionTwoLines-HSV.cpp:(.text+0x4c88): undefined reference to `cvInitFont'
CarMotionTwoLines-HSV.cpp:(.text+0x4db0): undefined reference to `cvPutText'
CarMotionTwoLines-HSV.cpp:(.text+0x4f08): undefined reference to `cvPutText'
CarMotionTwoLines-HSV.cpp:(.text+0x5148): undefined reference to `cvRectangle'
CarMotionTwoLines-HSV.cpp:(.text+0x5338): undefined reference to `cvRectangle'
CarMotionTwoLines-HSV.cpp:(.text+0x5794): undefined reference to `cvRectangle'
CarMotionTwoLines-HSV.cpp:(.text+0x57b8): undefined reference to `cvInitFont'
CarMotionTwoLines-HSV.cpp:(.text+0x5920): undefined reference to `cvPutText'
CarMotionTwoLines-HSV.cpp:(.text+0x5b50): undefined reference to `cvRectangle'
CarMotionTwoLines-HSV.cpp:(.text+0x6374): undefined reference to `cvRectangle'
CarMotionTwoLines-HSV.cpp:(.text+0x6398): undefined reference to `cvInitFont'
CarMotionTwoLines-HSV.cpp:(.text+0x6500): undefined reference to `cvPutText'
CarMotionTwoLines-HSV.cpp:(.text+0x6654): undefined reference to `cvPutText'
CarMotionTwoLines-HSV.cpp:(.text+0x6844): undefined reference to `cvRectangle'
CarMotionTwoLines-HSV.cpp:(.text+0x69cc): undefined reference to `cvInitFont'
CarMotionTwoLines-HSV.cpp:(.text+0x6af4): undefined reference to `cvPutText'
CarMotionTwoLines-HSV.cpp:(.text+0x6c4c): undefined reference to `cvPutText'
CarMotionTwoLines-HSV.cpp:(.text+0x6e7c): undefined reference to `cvRectangle'
CarMotionTwoLines-HSV.cpp:(.text+0x706c): undefined reference to `cvRectangle'
/tmp/cclicE4h.o: In function `idTrackCarPersonOneLine(_IplImage*, int**, std::_Rb_tree_const_iterator<std::pair<unsigned int const, cvb::CvBlob*> >, std::_Rb_tree_const_iterator<std::pair<unsigned int const, cvb::CvTrack*> >, int, double, double, CvFont, char*, int**, int**, int&, int&, int*, int*, int*, int*, int*, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int**)':
CarMotionTwoLines-HSV ...
(more)
edit retag flag offensive close merge delete

Comments

opencv's c-api died in 2010, please avoid any 3rd party libs, that build on deprecated api/functionality.

why do you think, you need this lib ?

(then, you're not linking any opencv libs..)

berak gravatar imageberak ( 2015-11-05 11:21:40 -0500 )edit

@berak Could you please explain in detail. I am new to OpenCV

pradeep_kb gravatar imagepradeep_kb ( 2015-11-05 11:25:51 -0500 )edit
1

a:) you should avoid any code, that has IplImage* in it. the project you're trying to compile is most likely horribly outdated.

b:) your cmdline is missing libs, like: g++ CarMotionTwoLines-HSV.cpp -lopencv_core -lopencv_imgproc -lmore_libs

berak gravatar imageberak ( 2015-11-05 11:29:21 -0500 )edit

@berak Thank you.. I compiled with linking the libraries.. errors got resolved.

pradeep_kb gravatar imagepradeep_kb ( 2015-11-07 15:32:43 -0500 )edit