views:

645

answers:

4

Hello,

I turned my C++ Dynamic link library into Static library just to acquire more knowledge. My question is how can I use the .obj file to compile both projects with C# express/MS visual studio?

+2  A: 

No, you can't access static libraries directly from C#. You have to use a DLL.

Jon Skeet
I have to use a DLL,but Jon Skeet doesn't have to,he can compile anything. :)Thanks Jon.
John
+1  A: 

No way to do that.

Only call DLL functions in runtime or create a COM object from your library

abatishchev
+1  A: 

"Static library" means that the library is going to be merged with your final application. This concept doesn't exist in .net. .net supports DLLs only.

Mohammad Tayseer
+4  A: 

The way to "use" a static library in C# is to first create a Managed C++ wrapper that will provide a facade for the rest of the managed world. As everyone else has already commented, C# only supports DLLs for P/Invoke.

Erich Mirabal