Compile c vs 2005 code

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

And it really makes me appreciate the automatic compilation of eclipse, which is much more, which is my normal IDE, since I use java for my work on a day to day basis.

+1


source to share


3 answers


You can start with a C ++ project and just remove the default .cpp files and create your own .c files.



By default, the project is compiled according to the file extension.

+2


source


If your C source code doesn't contain any GUI elements, you should probably create a console project. BTW, posting the error messages should make the issue clearer.



0


source


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

When you use the IDE to say that you want to create a new project, you will be prompted to choose which project: if your software includes a feature main

(not WinMain

) then you should say that you want to create a project for the "Console Application" ...

After you have created this new project, add the existing * .c (and * .h) files to the project and delete the default * .c file that was created automatically by the project.

0


source







All Articles