Ask Your Question
0

giving an error when i include opencv librariry files

asked 2014-09-30 03:10:58 -0600

kanchan gravatar image

dear,

i am trying to compile the opencv code, but it is giving me an error while compiling the opencv program. i guess the problem is with i is not able to detect opencv library file. but i am not getting that error ..i have included each and every path.

kanchan@Mylappi:~$ arm-linux-g++ -O2 -I/usr/local/include/opencv bck_sub.cpp -L/home/kanchan/opencv/opencv-2.4.9/build/lib -o find_obj -lcv -lhighgui -lcxcore -lml -lcvaux -lrt -lpthread -ldl -lz -lpng12 -ljpeg cc1plus: warning: include location "/usr/local/include/opencv" is unsafe for cross-compilation bck_sub.cpp: In function 'int main(int, char**)': bck_sub.cpp:12: error: 'VideoCapture' is not a member of 'cv' bck_sub.cpp:12: error: expected ;' before 'cap' bck_sub.cpp:13: error: 'BackgroundSubtractorMOG2' is not a member of 'cv' bck_sub.cpp:13: error: expected;' before 'bg' bck_sub.cpp:14: error: 'bg' was not declared in this scope bck_sub.cpp:19: error: 'namedWindow' is not a member of 'cv' bck_sub.cpp:20: error: 'namedWindow' is not a member of 'cv' bck_sub.cpp:24: error: 'cap' was not declared in this scope bck_sub.cpp:31: error: 'imshow' is not a member of 'cv' bck_sub.cpp:32: error: 'imshow' is not a member of 'cv' bck_sub.cpp:33: error: 'waitKey' is not a member of 'cv' kanchan@Mylappi:~$

edit retag flag offensive close merge delete

Comments

apart from your current problem (which headers do you include ?) i can already see the next one coming up:

-lcv -lhighgui -lcxcore -lml -lcvaux

all of them outdated opencv1.0 libs (they don't exist any more) use -lopencv_core -lopencv_highgui, etc. instead

berak gravatar imageberak ( 2014-09-30 03:39:33 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-09-30 03:43:04 -0600

It would help to also have the code that causes this errors. Have you included the highgui-header? #include <opencv2 highgui="" highgui.hpp="">

?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-09-30 03:10:58 -0600

Seen: 2,529 times

Last updated: Sep 30 '14