0

I have been having this issue with OpenCV 2.4.2 that it doesn't really get installed properly with Microsoft VS 2010 Express; It is always missing a dll file or two doesn't matter what I follow by Googling. Also, Visual Studio 2010 Express is only valid for a few days, so it is acceptable that VS will not behave well with OpenCV at that point. However, when I changed my IDE to CodeBlocks, it is even stranger because now I have missing dll files and also "Missing Entry Point" error because of a duplicate .dll file. I found this guide and followed what it told me to do:

http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/

But it still doesn't work!! What I am after is a complete and definitive solution to integrating OpenCV (preferrably 2.4.2 version) on a Windows 7 64-bit machine. I have been turning Stackoverflow inside out but no solution is working for me. The problems are

WHEN USING VISUAL STUDIO: Missing dll file (e.g. libopencv_core242d.dll, etc.)

WHEN USING CODE BLOCKS: First it complains that libstdc++-6.dll is missing. When I download it to my C:\MinGW\libexec\gcc\mingw32\4.7.0 folder, it stops complaining about this. But now it complains that there is any entry point problem and some other .dll file is missing!!!

If someone has managed to make it work by hook or crook, I will be more than happy to know what it is, IN DEPTH. I don't believe that such an important library can be so stupidly distributed so that developers have to struggle night and day to make this work.

FYI, I have tried even the OPenCV website and frankly their instructions are a bit useless. Also, all the necessary information e.g. adding PATH, adding includes and libraries, etc. Please someone point me to the right direction as it has been two days and I cannot get anywhere. It is literally stopping my job now :(

ha9u63a7
  • 6,233
  • 16
  • 73
  • 108
  • 1] Do you really need to build openCV ? why won't the pre-built version work ? 2] Have you added the path to openCV's dll's to your environmental path variable ? – volting Oct 26 '12 at 21:07
  • Well, I didn't try the pre-built version. I am now trying to do it all over again by installing MinGW separately, and then OpenCV (and building the files using CMake). If I manage to make something work, I will let you know – ha9u63a7 Oct 26 '12 at 21:45
  • New Problem!! Now it says,"The program cannot start because the libopencv_core243.dll is missing from your computer...." I checked my Linker library location, additional library paths, etc. They are all okay and the files do exist.....AAARGH...!!! – ha9u63a7 Oct 26 '12 at 23:30
  • Put this dll into folder where .exe is located. – arrowd Oct 27 '12 at 06:45
  • or add the folder where opencv's dlls are to your systems enviromental path variable like I suggested in my first comment. http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx – volting Oct 27 '12 at 10:35
  • I tried to find the details of the error through the event viewer in Windows...I cannot put the entire thingy in the comment box (not enough space) but here it is | testOpenCv.exe | 0.0.0.0 | 508ca10e | libstdc++-6.dll | 0.0.0.0 | 4f773dbe | c0000005 | 000257ac | 4cc | 01cdb4b96ffd2291 | C:\vcpp\Projects\testOpenCv\bin\Debug\testOpenCv.exe | C:\MinGW\bin\libstdc++-6.dll | ae34c114-20ac-11e2-bc9b-60d819bf134c Does this help anybody to understand what could be wrong???? – ha9u63a7 Oct 28 '12 at 03:14
  • I think the debug output from code::blocks would be better, and the full error log would be more helpful, update your original question with it. -Also this answer may be helpfull --> http://stackoverflow.com/a/6405064/252701 – volting Nov 01 '12 at 21:05
  • @volting I managed to solve it later on by 1) Uninstalling and Reinstalling code blocks (without MinGW package). 2) Reinstalling MinGW compiler and then setting up the PATH to C:\MinGW\bin 3) and continue the rest using the guideline I posed in the original message. Most importantly, I had to copy the openCV's .dll files to the executable folder (if memory serves me right) just to be sure that they were not missing. – ha9u63a7 Nov 02 '12 at 08:18
  • Good to hear... you should post that as answer then.. – volting Nov 02 '12 at 10:17

1 Answers1

1

As an answer, but probably a very simple one, I did the following and got rid of the problem:

1) Uninstalled code::blocks completely from the PC and downloaded the IDE-only version (i.e. withouth MinGW compiler), then installed it.

2) Downloaded the latest stable version of MinGW, installed, and added C:\MinGW\bin to PATH

3) Followed rest of the instructions from [link] http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/

4) Just to be sure, copied the opencv .dll files from the build folder (i.e. the one that you have created "make" and "install" files using CMake) to the debug (i.e. the executables') folder.

This will fix the problems. In case, it doesn't it might be that you need to add some environment variables.

ha9u63a7
  • 6,233
  • 16
  • 73
  • 108
  • btw did anyone get into trouble using OpenCV libraries on Windows 7 64-bit? Regardless of uxing x86 or x64 libraries in the build folder, OpenCV crashes PC...did anyone had this problem? – ha9u63a7 Nov 10 '12 at 11:46