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
 
create a c#project in VS2005, then add that file into this project.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top