Reputation: 7071
Do you know if it's possible to programm c (not c++) in Visual Studio 2008? If yes then how? I haven't found any component for that.
Regards.
Upvotes: 2
Views: 9829
Reputation: 160
It does not work because C++ precompiled headers, so the solution is select project-properties-c/c++-precompiled headers Then select Not Using Precompiled Headers
Upvotes: 1
Reputation: 507
If you want to make a .c program in Visual Studio 2008:
Goto>>File>>New>>Project
Choose "Visual C++" in the left column, then in the right column, select "Win 32 Console Application".
Write file name as:
"Any_Name.c"
Here you can now create a C program:
Upvotes: 1
Reputation: 78914
Just save the file with .c extension instead of .cpp and it will compile as C instead of C++. To be extra cautious, you can go to the project settings, under "Project -> Properties -> Configuration Properties -> C/C++ -> Advanced", make sure that "Compile As" says "Compile as C code (/TC)".
Upvotes: 14
Reputation: 4187
As long as your source file has the .c
extension, Microsoft C++ compiler will compile in C-mode.
In addition, the /Tc<source filename>
switch can be used to force compilation of a specific file in C mode, and the /TC
switch can be used to force C mode for all files. For C++, it's /Tp
and /TP
respectively.
Upvotes: 6
Reputation: 10687
You can specify any compiler you'd like in VisualStudio; therefore, if there's a specific C compiler you'd like to use, it will handle it.
Upvotes: 1