0

I am using Eclipse Helios with cdt plugin and I have also downloaded MINGW. Now I have copy pasted the basic Opencv program which I found here OpenCV on eclipse on windows I have followed all the instructions given in this link, and also search other few links. I have also added the open cv path by going to project properties. But still it is showng that

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lopencv_core opencv_imgproc opencv_highgui opencv_ml opencv_video opencv_features2d opencv_calib3d opencv_objdetect opencv_contrib opencv_legacy opencv_flann

I have checked multiple times and added these variables to library. please help.

Community
  • 1
  • 1
user3917116
  • 1
  • 1
  • 1
  • is the opencv_core library somewhere on your harddrive? often the files are called something like opencv_core481 instead. you probably have to add to linker "additional library pathes" the path where the libraries are located. It's not enough to add the openCV base directory (since there are no libraries at all). Keep in mind that there are two places in project settings where to add directories: "additional includes" (add the base directory there) and "additional linker directories" or sth, where to add library pathes. – Micka Oct 22 '14 at 07:56

1 Answers1

0

Have you compiled opencv by yourself? I believe that there is no pre-compiled opencv library release for mingw, but precompiled opencv library with visual c++ 10, 11, 12 are available.

If you have not compiled opencv, you need to follow the instructions:

  1. Go to this link. This link is useful. Specifically, in your case, you need to visit the link titled Installation in Windows
  2. Carefully watched both videos in the mentioned page above, specifically 1st video and the beginning part of the 2nd video. I know the steps is for visual studio compilation, but it is useful to gain some feelings of the compilation steps.
  3. Follow this video to do the compilation of opencv on MINGW

Note: Lots of information is out of date in the above videos. You need to modify/adapt the steps mentioned in the videos.

Note: I know the video in the 3rd step is not in English. However, it is the video for the latest version of opencv I can find, for MINGW.

Tips: make sure you clean up all CMake erorrs before you really generate makefile to compile opencv.

Note: The compile procedure for opencv on mingw does NOT depend on Qt (I know you are using Eclipse).

Please prepare to spend lots of time for this compilation, as it does require you to download many tools for this compilation, such as CMake.

Many steps described in the video can be skipped, if you don't want to use those components. For example, if you don't want to use python, you don't need to download python.

Good luck, and enjoy.

Robin Hsu
  • 4,164
  • 3
  • 20
  • 37
  • Those 3 videos are exactly what I used to install opencv in my computer, for Qt. (Yet I searched and watched many other videos and found them duplicate or useless except for these three). – Robin Hsu Oct 22 '14 at 08:25
  • I am using eclipse.. not Vusal studio.. already I am too much annoyed with windows products... I do not have any option thats why I am using windows operating system.. otherwise I could have been shifted to linux... :( – user3917116 Oct 22 '14 at 11:42
  • and I have seen these videos... followed the instructions also... I have downloaded opencv version 3.0.0 from the sourceforge.net ... I think the last way is to uninstall the software and re-install it.. thank you for your kind help.. let me check after re-installing the whole software. – user3917116 Oct 22 '14 at 11:44
  • I checked my opencv library: it only has ./bin/libopencv_core249.dll. Nothing is called libopencv_core.dll. I believe you need to do some symbolic link (I don't know if symbolic links works on windows) or just a copy it to the name libopencv_core.dll, since your ld.exe is requesting that by the -l library option (-lopencv_core). (249== v2.4.9, which is my opencv version, yours may differs) – Robin Hsu Oct 23 '14 at 06:43
  • Have you checked how to add a library into your Eclipse project? In other words, have you added any library (not limited to opencv) successfully? I am not quite sure how to do it in Eclipse. In Qt, it's simple. Just add the library files. In Qt, I don't have to figure out that I need to skip the first 3 characters 'lib', like the -l option "-lopencv_core" meaning to add "libopencv_core.dll" – Robin Hsu Oct 23 '14 at 07:58
  • thanks Robin for your kind attention.. But Now I switched to Xubuntu 14.04 lts version. So I think this thread can be marked as closed. but would you please elaborate about symbolic links.Because it may happend that I face same situation in linux also. really thanks alot for your attention – user3917116 Oct 31 '14 at 21:00
  • What you mean by symbolic links? What do you want me to elaborate? – Robin Hsu Nov 03 '14 at 05:57