0

Iam having problems with dll import in c#. I created library under windows xp x32 and tried to use it on windows 7 x32. My library is using another libraries called opnecvsharp which uses dllimport to opencv libraries for c++.

Iam sure i added opencv.dlls to the same folder as executable file. I tried to run exe as admin, disable UAC, add path to dll in PATH variable, but none of those helped me.

How I can make my program see dlls ?
The error in picture shows that program doesnt see opencv dll libraries. Opencvsharp provides only dlls and no soruce file so I cannot paste here code how it is imported.

Image

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
user1042321
  • 45
  • 1
  • 9
  • 1
    Does it function in the Windows XP environment in the way you think it should? Can you also show us your Pinvoke signature for the method that you're calling? It may help us see what may be happening. – Bob G Nov 22 '11 at 13:08
  • 1
    It seems pretty clear that your system is missing `opencv_core220` – David Heffernan Nov 22 '11 at 13:26
  • What you mean by system is missing opnecvcore220? I added this library to folder where i run exe file so there should not be any problems. – user1042321 Nov 22 '11 at 13:27
  • OK, the message could be a false positive. It may report that if a dependency failed. Did you install the MS C++ redist package on the Windows 7 machine? – David Heffernan Nov 22 '11 at 13:29
  • Yes I installed it automactly with visual c# 2008 – user1042321 Nov 22 '11 at 13:38

1 Answers1

2

Although the error message reports that the opencv_core220 library is missing, you are adamant that it is present in the same directory as the executable. Thus it seems likely that one of the OpenCV dependencies is failing.

The most likely and plausible cause for this is the the Visual C++ redistributable package has not been installed on the target machine.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • I installed Microsoft windows c# 2008 which also installed c++ redistibutable package. I used depenedency walker on exe file but it shows me only dlls which are in windows directory. – user1042321 Nov 22 '11 at 13:36
  • Ok i found solution to this. I needed to install c++ redistributable 2010. Hope it helps someone. – user1042321 Nov 22 '11 at 15:27
  • Yes but I had instaled c++ redistributable package 2008 not 2010 thats why it wasnt working – user1042321 Nov 22 '11 at 21:54
  • Yes, I can see that now. I'm not familiar with the precise details of OpenCv. I just assumed that you had installed the runtime described in the OpenCv docs. – David Heffernan Nov 22 '11 at 21:55