Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile C# application with C++ static library?

Tags:

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?

like image 814
Ivan Prodanov Avatar asked Apr 08 '09 11:04

Ivan Prodanov


People also ask

What is the command to compile C?

Run the gcc command to compile your C program. The syntax you'll use is gcc filename. c -o filename.exe . This compiles the program and makes it executable.

How do I compile a C file in Windows?

Type "cl filename. c" (without quotes) and press the "Enter" key to compile the code page. The C file is compiled into an executable (EXE) file named "filename.exe."

How does C compile work?

The compiler checks the source code for the syntactical or structural errors, and if the source code is error-free, then it generates the object code. The c compilation process converts the source code taken as input into the object code or machine code.


1 Answers

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

like image 180
Jon Skeet Avatar answered Oct 21 '22 11:10

Jon Skeet