set visual studio 2008 compiler for c not c++
I have installed visual studio 2008 and i want to create some simple applications using C language. I do this by creating c++ console applications but i want the compiler to work for C not C++. Any wa开发者_JAVA百科y to accomplish this or i need another compiler if i want to deal with C?
Use .c file extension instead of .cpp, those files will be compiled as C-only code by default in a C/C++ Visual Studio project.
Just create files ending with .c instead of .cpp - MSVC will run the C compiler on them automatically. Note that it also allows you to intermix C and C++ freely (in different files, of course), as long as you stick to the rules (extern "C"
, etc.)
Try using /TP
/TC
compiler flags, you can find them in compiler group of project settings. Flags are documented here: MSDN.
精彩评论