How to create project from c file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a simple C# in single file. I can compile by using csc. I would like
to create a project/solution for that c# file. How to do that?

Regards
Quang
 
If you already have a C# project and you want to add a C file to it,
add it like you would a C# file. To compile I believe you need a flag
before and after your C code to let the compiler know it is compiling C
instead of C#. I think the flag is

extern "C" but I could be wrong. Try looking for information on the
extern flag.

Another solution could be to compile your C code into a DLL and import
the functions you need. I don't know if this would work for what you're
doing. Maybe you can explain your needs a little more.

Also try reading through the discussion here on programming in more
than one language in .NET

http://weblogs.asp.net/dreilly/archive/2003/05/17/7164.aspx

Hope all this helps.
 
Back
Top