Install Opencv ON eclipse in ubuntu
Hi,
i use these link for installation :
1-http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/
2-http://zacg.github.io/blog/2013/05/02/installing-opencv-2-dot-4-5-on-ubuntu-12-with-eclipse-cde/
3-http://rodrigoberriel.com/2014/10/using-opencv-3-0-0-with-eclipse/
BUT i have error in eclipse when compile program.the error in console is /usr/bin/ld: cannot find -lopencv_core. how can i set /usr/bin , already i set /usr/local/lib for lib component.
full error in "eclipse console" is :
09:44:55 * Build of configuration Release for project Test * make all Building file: ../src/Test.cpp Invoking: GCC C++ Compiler g++ -I/usr/local/include/opencv2 -I/usr/local/include -I/usr/local/include/opencv -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Test.d" -MT"src/Test.d" -o "src/Test.o" "../src/Test.cpp" Finished building: ../src/Test.cpp
Building target: Test Invoking: GCC C++ Linker g++ -L/usr/local/lib -o "Test" ./src/Test.o -lopencv_core\ opencv_nonfree\ opencv_imgproc\ opencv_highgui\ opencv_ml\ opencv_video\ opencv_features2d\ opencv_calib3d\ opencv_objdetect\ opencv_contrib\ opencv_legacy\ opencv_flann /usr/bin/ld: cannot find -lopencv_core opencv_nonfree opencv_imgproc opencv_highgui opencv_ml opencv_video opencv_features2d opencv_calib3d opencv_objdetect opencv_contrib opencv_legacy opencv_flann collect2: error: ld returned 1 exit status make: * [Test] Error 1
09:44:56 Build Finished (took 538ms)
also the error in "eclipse problem" is:
Description Resource Path Location Type cannot find -lopencv_core opencv_nonfree opencv_imgproc opencv_highgui opencv_ml opencv_video opencv_features2d opencv_calib3d opencv_objdetect opencv_contrib opencv_legacy opencv_flann Test C/C++ Problem
Many Thanks
Did you check if the library files are present in /usr/local/lib? There should be files like libopencv_core.so. And make sure that you have read access to the files and read+execute flags for all folders.
i have access to all folder because i run eclipse with root user.also i take picture from lib folder.it is in first comment. in the eclipse console say can not find these file in /usr/bin/ld. how can sole it. Thanks
ld is your linker. Did you check if it is installed in /usr/bin ?
this is "CDT build console" error in eclipse : /usr/bin/ld: cannot find -lopencv_core opencv_nonfree opencv_imgproc opencv_highgui ...
i check usr/bin folder . there is a ld file . how can i test that these component installed in ld file.
which ld =/usr/bin/ld
I don't understand your question. Your library should not be installed in the linker. Do you know what a linker is?
i mean that the ld file is /usr/bin/ld. but why can not the eclipse find opencv_core opencv_nonfree opencv_imgproc opencv_highgui.. there . how solve it. please see new picture from error in the first comment Thanks.
It seems that you are missing a -l in front of most of your libraries
However, I don't know how to change that in eclipse.
missing in /usr/bin/ld . the files are in /usr/local/lib . and add in eclipse. i take picture from it the problem is in /usr/bin/ld.
The linker program ld cannot find the libraries. As I said in my previous comment: I assume that you need a -l in front of all library names. This is so if you use ld directly. However, I don't use eclipse and therefore don't know which influence it has and if it changes the syntax of ld.
I manually add lib files(opencv_core .....) from usr/local/lib to the folder usr/bin. also added these file name to eclipse one by one and no ones all of them. then every thing is ok. Thanks