QuestionAdditional libraries / DLLs

0 views
Skip to first unread message

AMIN

unread,
Jul 19, 2009, 5:58:50 PM7/19/09
to Visual C++ Lovers
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

Kira Qian

unread,
Sep 1, 2009, 8:57:10 AM9/1/09
to Visual C++ Lovers
Hi AMin,

You can try to compile your assembly for .net clr support. Below is
the step.

1. Right click your project -> properties -> Configuration properties -
> General.
2. Under the "Project Defaults" category, you can see "Common Language
Runtime support", the default value for it is "No Common Language
Runtime support". Change it to "Common Language Runtime Support (/
clr)".
3. Build your project. So that the assembly can be used in .NET app.

Does that work?
Reply all
Reply to author
Forward
0 new messages