Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to compile a C pgm using MS Visual C++?

Status
Not open for further replies.

Cat123

Programmer
Sep 12, 2002
2
CA
Hi, I just want to compile a simple "hello world" program in MS Visual C++. I addded /TC to the compile options under the project settings menu. But it complains at:

#include <stdio.h>

Also, it gives the source file the .cpp extension instead of the .c extension. It did this when I created the project using the wizard by asking for a win32 console application. (I tried changing the extension manually, but it didn't work)


How can I NOT use the wizard to compile a simple C program? (I'd rather not do it at the command line....)


Thank You!
 
1 Start up VC++
2 File/New... type in a project name, select win32 console application, click ok
3 Next dialog: Click on empty project, click Finish
4 Next dialog: Just a confirmation: Click ok
5 Click on file view - you will see a tree with the workspace and the project. Expand the project by clicking on the +
6 Right click on the project name, Add files to project ...
Specify a filename.
7 Expand source
8 Double click on the filename
9 Dialog: asks whether you wish to create the file - yes
10 Type in your program
11 F7 to compile
12 F5 to run - you may have to set a breakpoint on the }. If yours is a fast machine, it will just flash up and disappear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top