There are many IDEs available for use with C++. The textbook describes getting started with Visual C++ 6.0. The process is fairly similar under newer versions of Visual C++. There are also several other, widely used and free, IDEs for windows. What follows are the instructions provided by the textbook converted to the two most popular of these, Dev-C++ and Code::Blocks. Which one you choose is up to you. They are different IDEs but the code presented in the text will work the same on any of these compilers. The recommended IDE for the workshop is still
Visual C++ EEGetting Started With Your Compiler
-- Dev-C++ Version --You can download Dev-C++ for free from
here. The following instructions assume that you have download and installed Dev-C++ correctly. installing it is easy, just run the installer, and when in doubt select everything. [smile]
Building the Hello world ProjectTo create and test the Hello World program, follow these steps.
1. Start Dev-C++.
2. Choose File, New, Project from the meus.
3. Choose Empty Project and enter a project name, such as hello. Make sure "C++ project" is selected, and not "C project". Click Ok.
4. Save the .dev file. Preferably this should be in a new folder created to store all the files for this project - "\Projects\hello\hello.dev" for example.
5. Choose File, New, Source File from the menus. Click yes when it asks you if you wish to add the source file to the project.
6. Choose File, Save from the menus. Call the new file "main.cpp". This should be in the same directory as your .dev file, so as per the previous example "\Projects\hello\main.cpp".
7. Enter the code as indicated previously.
8. Choose Execute, Compile from the menus.
9. Check that you have no build errors. You can find this information near the bottom of the editor.
10. Run the program by selecting Execute, Run from the menus.
NOTE:
When you run the program, it will more than likely flash on screen and disappear again. The reason for this is that the program is finished and exits straight away. The solution is described in the FAQ just under this section in the textbook (Page 20).
Getting Started With Your Compiler
-- Code::Blocks Version --You can download Code::Blocks from
here. Download "Code::Blocks IDE, with MINGW compiler" if on Windows. The following instructions assume that you have downloaded and installed Code::Blocks correctly.
Building the Hello world Project1. Start Code::Blocks.
2. Choose File, New Project... from the menus.
3. Select Console Application. Ensure that "C++ source" is selected in the File(s) options box. Select "Do not create any files". Click Create.
4. Save the .cbp file. Give it the name of your project. In this case "hello.cbp". Preferably this should be in a new folder created to store all the files for this project - "\Projects\hello\hello.cbp" for example.
5. Choose File, New File from the menus.
6. Call the file "main.cpp" and click Save. This should be in the same directory as your .cbp file, so as per the previous example "\Projects\hello\main.cpp". Click yes, when it asks you if you want to add the new file to the active project.
7. Enter the code as indicated previously.
8. Choose Build, Build from the menus.
9. Check that you have no build errors. You can find this information near the bottom of the editor.
10. Run the program by selecting Build, Run from the menus.
11. Press enter to end the program.