This message was posted on behalf of Intel Corporation
According to http://stackoverflow.com/questions/27593029/c-compile-collect2-error-ld-returned-1-exit-status and http://stackoverflow.com/questions/27272525/what-does-collect2-error-ld-returned-1-exit-status-mean the error you are getting is usually related to the c code not the installation of the package. Post your code here to see if I can help you find any errors.
The linker cannot find opencv's libraries. You can point to the libraries with the -L option for g++ or set an envrionmental variable.
Could you try running the following command before the command and let me know if that works?
Here is my c++ code..
using namespace cv;
int main(int, char**)
VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
cap >> frame; // get a new frame from camera
cap >> frame;
cap >> frame;
I think error is not in c++ code but error is linking with opencv libraries as I get error like " cannot find -lopencv_ts ". And I don't know why it's getting me error like that when I it's showing all libraries are there in path when I am executing command " pkg-config --cflags --libs opencv " and same command I am linking with g++ cameratest.cpp -o newest command.
I have tried export LD_LIBRARY_PATH=/usr/lib/opencv command also but still same error:
/usr/lib/gcc/i586-poky-linux/4.8.2/../../../../i586-poky-linux/bin/ld: cannot find -lopencv_ts
collect2: error: ld returned 1 exit status
Could you post the output of the two commands below?
ls -la /usr/lib
ls -la /usr/lib/opencv
I tried those commands and in output I got most of all libopencv_*.so libraries except libopencv_ts.so .
So I think libopencv_ts.so and relating to libopencv_ts files are missing from /usr/lib/ location. So how can I resolve that any idea?
Solved error by removing -lopencv_ts from /usr/lib/pkgconfig/opencv.pc file. As my program don't need libopencv_ts library.
Thank you all for your help.