tags:

views:

359

answers:

1

Hi I am working on OpenCV library, this library is written in C++, i have written a simple win32 application. I have some simple functionalities implemented in it. This functionality needs additional libraries and i am using Project->Properties->Configuration properties -> Linker -> input -> Additional dependencies to specify the additional lib files.

Now i want to write an application in C# that uses the the above project's DLL, i am using this DLL using [DllImport] method. When i run the application outside the visual studio it shows me "DllNotFoundException" for the Dll i am importing. I have placed dll file in build and code folders both.

can anyone suggest me why this problem is occuring? Is there any issue of dependent / additional libraries?

Please tell me how can i add additional libraries. I placed those additional DLLs in the build folder also, but it still gives me the error.

I tried another simple dll with no additional dependency, and it gave me no error, looks like there is some dependent library issue. Please suggest me how to resolve the problem

thanks in advance

A: 

Please see:

http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx

And:

http://homepages.tesco.net/J.deBoynePollard/FGA/dont-put-your-dll-in-the-system32-directory.html

Basically, you probably want to put a copy of your DLL into %CommonProgramFiles%\yourcompany\yourproject, and then you probably want to set the DLL directory to point there, so that your DLL is found.

Michael Aaron Safyan