As I wrote this tutorial, I performed the processes I'm going over, both to get accurate screenshots and so that I'd be sure my advice worked. I use Windows Xp Home, so if it works for me it should work for any Windows above and including Windows 95.
The first thing you need to do is go to the Bloodshed.net Downloads page and get the most recent Dev-C++ you can. During the writing of this tutorial, the most up-to-date Dev-C++ I could download from there was titled "Dev-C++ 5.0 beta 7 (4.9.7.0) with Mingw/GCC 3.2". Find the download page here.
If you already have Dev-C++ installed, take a minute now to delete or rename the existing folder; it is recommended to not install over an existing installation. New users should do a typical install and click every Next button you see until you get to Finish and click that. After it's installed, go to the new Dev-C++ directory (mine is c:\devcpp\) and run vUpdate.exe. If you're running Dev-C++ it will ask you to close it. Do so and hit the Retry button to continue. A window will pop up that looks like this:
Many of the important packages you may use can be downloaded with this program. To populate the frames as they are shown above, you first click on the checkmark button and wait. Once populated, you can browse the Packages frame and choose which packages you wish to install. At the very least, you should check off Dev-C++ Critical Update at the top. As you can see, I have highlighted the Allegro DevPak; I will be using it in other tutorials, so if you want to follow along with them, I would suggest that you get it now. If you hold your mouse over the name of a package, in the Descriptions frame you'll see a description of it. If you see other packages you want to download, check them off. When you're ready to get the packages, click the checkmark button to start.
For each DevKit you chose to install, a window will pop up. Click Install at the bottom, and when its done click Finish. When you click Finish, the Package Manager will load up - close it. Do this for each DevKit you downloaded. Once you're finished that, close vUpdate with the red x button at the bottom.
Now that everything has been downloaded and installed, we have to do some manual configurations. Load up Dev-C++. A messagebox should pop up to tell you that its your first time, OK your way past it. On the next window if you feel the need, choose your language and Dev-C++ theme; I usually pick English and checkmark Use XP Theme. OK your way past that. Now close the Tip of the Day. We're in!
For each of the directories listed below, you need to either type in the path or use the [...] button to browse to it, and then click the Add button. Add the following directories (change the path to your own Dev-C++ directory if needed):
C:\devcpp\include\c++\backward
C:\devcpp\include\c++\bits
C:\devcpp\include\c++\ext
C:\devcpp\include\c++\mingw32
C:\devcpp\include\c++\mingw32\bits
Click on the OK button and you're almost done. Let's make a sample project so you can see how it needs to be done.
Give your project a name; I called mine "hello world" as you can see. Make sure C++ Project is selected, click Console Application, and then click OK. Use the next dialog to browse to a place you want the project to be stored. I just made a folder on the desktop called "hello world" and stuck it in there.
Dev-C++ will automatically make a source file and put some stuff into it; we want to alter it a little so we have some output we can observe. Make the necessary changes to the source so it looks like the following:
#include <iostream> #include <cstdlib> using namespace std; int main(int argc, char *argv[]) { cout << "Hello, world!" << endl; system("PAUSE"); return 0; } |
Save the file using the given name and location; just hit the Save button when the browse window comes up. Before we can compile this, we need to tell the linker to use the standard C++ library - it isn't added by default. Click on Project > Project Options or use Alt+P. On the dialog, click on the Compiler tab and then the Compiler Options tab on the bottom. In the Linker editbox, add -lstdc++, as shown below:
Click OK to save the change. Now you can compile the project. Click Execute > Rebuild All (or use Ctrl+F11 or the Rebuild All button) and then click Execute > Run (or use Ctrl+F10 or the Run button) to run. Alternatively you could do it all at once by clicking Execute > Compile & Run (or use F9 or the Compile & Run button). Hopefully you'll wind up with something like this:
From now on you can skip right to the Setting up a Project because all of the things we set up above are going to stay for all projects. If for any reason this tutorial still doesn't get you up and running, either its out of date or there's something silly going on. The fastest way to get help that I know of is to post to the Dev-C++ discussion forums. You'll find a link to the forum if you click Help > About Dev-C++... and look near the bottom of the dialog. Good Luck!