views:

183

answers:

3

Is there an easy way to compile c code in visual studio 2005? Its been a while(2-3 years) since I've done any coding in either c or c++, but I remember that you used to be able ti, in vs 2003, compile c code in visual studio. I thought it was just a matter of using an empty project(rather than, say a c++ project or a C# project) and giving your file s a *.c extension. However, doing that, I can't seem to figure out how to compile. I'm sure I'm just doing something stupid or missing something obvious.

Ah, really makes me appreciate eclipse's auto compile that much more, which is my normal IDE since I use java for work on the day to day basis.

+2  A: 

You can start with a C++ project, and just delete the default .cpp files and make your own .c files.

The project defaults to compiling according to the file's extension.

Michael Burr
A: 

If your original C code does not involve any GUI elements, you probably should create a console project. BTW, posting your error messages should make the problem clearer.

PolyThinker
A: 

I thought it was just a matter of using an empty project ...

When you use the IDE to say you want to create a new project, you'll be asked to choose what kind of project: assuming that your software includes the main function (not WinMain) then you ought to say that you want to create a project for a "Console application".

After you've created this new project, add your existing *.c files (and *.h files) to the project, and delete the default *.c file which was created automatically with the project.

ChrisW