Thread: C++ Compile
View Single Post
Old May 28th, 2005, 4:12 AM   #3
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 296
Rep Power: 4 Klarre is on a distinguished road
If you are new at C++ I should recommend you to use Dev-C++ (http://www.bloodshed.net/devcpp.html) instead of the much more complex Visual C++.

To create an application in Visual C++, you first have to create a C++ project.
-> File -> New project
In the Visual C++ Projects folder, you should pick "Win32 Project"
Pick a name and a folder where to save your project and click "OK". Now there will pop up an "Application wizard" window, where you should click on "Application settings". Under "Additional options" select "Empty project". Also select "Console application", and click Finish. Now you have created a C++ project.
Now click the Project menu -> Add new item, and select C++-file. This one will now be added to your project. Now cut'n'paste this code below and hit the "Play" button next to the "Debug"-text.

------------------------------
#include <iostream>

int main()
{
std::cout << "It works\n";
system("pause");
return 0;
}
------------------------------

The system("pause") call makes the console window opened until you press any key. I recommend you to add this line to the program you are trying to compile.

Have a nice day

/Klarre
Klarre is offline   Reply With Quote