0

I have a 64-bit dll (Imageloc.dll) generated using opencv 2.4 in VS2010. It works fine when it's called on Windows 7. However, when I run it on windows 2000 server, it gives me

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Imageloc.dll' or one of its dependencies. The specified module could not be found. at Test.Program.Main(String[] args)

I have the environment path values set as follows on Windows 2000 just like Windows 7

C:\Applications\opencv\build\x64\vc10\bin; C:\Applications\opencv\build\common\tbb\intel64\vc10;

openCv 2.4 product installed in c:\Applications\opencv

Visual Studio is installed on Windows 7 but not on Windows 2000.

Any help is appreciated.

Update: I ran it on another computer that has Windows 7 but doesn't have Visual Studio and it gave me the same error. I ran it on Windows 2000 with Visual Studio and it worked. How does Visual Studio make it work?

The program of the dll is written in c++-cli and is compiled in /MD . Could it be related to some dlls of C runtime library or CLR dlls?

fmvpsenior
  • 197
  • 7
  • 22

4 Answers4

1

I imagine that you would have trouble running a 64-bit DLL on any 32-bit operating system, not just Windows 2000...

Neil
  • 54,642
  • 8
  • 60
  • 72
  • Windows 2000 I am using is on a 64-bit machine – fmvpsenior Jul 18 '12 at 23:55
  • There was an IA64 build of Windows 2000, but that wouldn't be able to run your x64 DLL either. – Neil Jul 18 '12 at 23:58
  • I ran it on another computer that has Windows 7 but doesn't have Visual Studio and it gave me the same error. I ran it on Windows 2000 with Visual Studio and it worked. Why having Visual Studio installed make it work? – fmvpsenior Jul 19 '12 at 00:01
1

If installing Visual Studio on the Win2K machine makes your program work, then you're probably missing the Visual C++ Runtime. You can set your C++ code to compile such that it doesn't need the runtime, but for a single deployment, it's just as easy to install the runtime.

x86: http://www.microsoft.com/en-us/download/details.aspx?id=5555

x64: http://www.microsoft.com/en-us/download/details.aspx?id=14632

David Yaw
  • 27,383
  • 4
  • 60
  • 93
0

It's because it's missing a dll that is loaded during compilation /clr /md options

fmvpsenior
  • 197
  • 7
  • 22
0

Having read the question more carefully this time I can point out that Visual Studio 2010 applications won't run on anything earlier than Windows XP Service Pack 2, since older versions of Windows don't have all of the APIs that it uses. However one of the answers to Issue using Visual Studio 2010 compiled C++ DLL in Windows 2000 does suggest a possible workaround in that you might be able to provide a stub library that implements the missing imports.

Community
  • 1
  • 1
Neil
  • 54,642
  • 8
  • 60
  • 72