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?