2

I intend to work with OpenCV 1.1 version and Matlab2011 together. The program uses call to load library. However, it returns an error

 > In loadlibrary at 347
  In Untitled at 4 
Error using loadlibrary (line 421)
There was an error loading the library "C:\Program Files
(x86)\OpenCV1.1\bin\cxcore110.dll"
C:\Program Files (x86)\OpenCV1.1\bin\cxcore110.dll is not a valid
Win32 application.

I have tested the program in Matlab 2008 and 2010 where it gives error of a different kind I have installed x64 Compilers and Tools and my system has Visual Studio2008 and 2010 with SDK7 and 6.1. Also, on doing MEX setup I get the following options Select a compiler:

[1] Microsoft Software Development Kit (SDK) 7.1 in c:\Program Files (x86)\Microsoft Visual Studio 10.0 
[2] Microsoft Visual C++ 2010 Express in c:\Program Files (x86)\Microsoft Visual Studio 10.0 

[0] None 

Compiler: 2

This also returns the error

Error in ==> untitled at 5
loadlibrary(...

I am perplexed at what to do as this problem is persistently appearing. I even followed the thread in link where tit mentions that 2011 supports load library. So,why does it not work?Please help.

Amro
  • 123,847
  • 25
  • 243
  • 454
George Roy
  • 307
  • 1
  • 3
  • 8

1 Answers1

1

Applications compiled for 32bits don't mix with applications compiled for 64bits. If your OpenCV was compiled for 32bits, make sure Matlab is 32bits as well as your compilers.

BTW, seriously consider moving to a more recent version. OpenCV 1.1 is jurassic!

karlphillip
  • 92,053
  • 36
  • 243
  • 426
  • How do I revert to 32 bit opencv or compile opencv for 64 bits?Please elaborate. – George Roy Feb 28 '12 at 16:45
  • **1-** How do you usually remove installed software from your computer? **2-** [Compiling OpenCV 64bits](http://mechatronicscraze.wordpress.com/2011/07/08/installing-opencv-2-3-in-windows-7-64-bit-edition/) **3-** [Install OpenCV 2.3.x 32bits](http://stackoverflow.com/questions/7011238/opencv-2-3-c-visual-studio-2010/7014918#7014918). All these references were easily found by Googling. – karlphillip Feb 28 '12 at 17:01
  • Thank you. I really need to work with OpenCV 1.1 for some weird reason so final question is that the 1.1 ver does not have any exe file.So,would the links provided by you be applicable to OpenCV1.1? – George Roy Feb 28 '12 at 18:46
  • Probably not, v1.1 was released right after the [Big Bang](http://en.wikipedia.org/wiki/Big_Bang). – karlphillip Feb 28 '12 at 18:49
  • Hi,I followed all the download and install instructions. I installed OpenCv and Visual Studio using makefile and linking include etc. However, when I want to test just opencv using VS2010 it returns error Cannot find or open the PDB file associated with all the dlls. Please note that I am running VS2010 Express in Administrator mode. What to do plz help. – George Roy Feb 29 '12 at 02:45
  • How about sending a message to OpenCV mailing list? I don't know a single soul in this forum that still uses this version. Sorry. – karlphillip Feb 29 '12 at 03:42
  • I have used opencv2.3 and not1.1 and followed the steps given in your links. – George Roy Feb 29 '12 at 06:48