1

I am trying to detect faces and eyes from a video captured by webcam. I am using eclipse and opencv-2.3.1 on ubuntu 11.10. I want to write this code in C/C++. I configured eclipse by looking at the tutorials.I got the code online as objectDetection.cpp

I am getting the error as below:

> **** Build of configuration Release for project opencv_try **** make all 
> Building file: ../objectDetection2.cpp 
> Invoking: GCC C++ Compiler 
> g++ -I/home/vidula/OpenCV-2.3.1/include/opencv -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"objectDetection2.d" -MT"objectDetection2.d" -o"objectDetection2.o" "../objectDetection2.cpp" 
> Finished building: ../objectDetection2.cpp  
> Building target: opencv_try 
> Invoking: GCC C++ Linker 
> g++ -L/usr/lib -L/home/vidula/OpenCV-2.3.1/lib -L/home/vidula/OpenCV-2.3.1/modules/imgproc/include/opencv2/imgproc -o"opencv_try"  ./objectDetection2.o   -lopencv_core -lopencv_highgui 
> /usr/bin/ld: ./objectDetection2.o: undefined reference to symbol 'cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)' 
> /usr/bin/ld: note: 'cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)' is defined in DSO /usr/local/lib/libopencv_imgproc.so.2.3 so try adding it to the linker command line 
> /usr/local/lib/libopencv_imgproc.so.2.3: could not read symbols: Invalid operation collect2: ld returned 1 exit status make:
> *** [opencv_try] Error 1

I tried linking it to linkers but I don't know what I am doing wrong. Can anyone help me figure out what is wrong?

1 Answer 1

1

It looks like it is telling you that the cv::cvtColor symbol you need is in the libopencv_imgproc library, so you need to add that one to your linker options with the option -lopencv_imgproc, just like you did with core and highgui

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.