Putting C:\Dev-Cpp\bin and C:\Dev-Cpp on your PATH

The following assumes that you are logged on with Administrator privileges. Since that is the (amazingly insecure) default with Microsoft, you may assume that this is the case if you do not know otherwise.

  1. Determine what drive you installed Dev-Cpp onto -- you can look in Windows Explorer to find this out. Let us assume for this example that you want to install on the C: drive.
  2. If you have installed on the D: drive (for example), then instead of C:\Dev-Cpp\bin in the following, write D:\Dev-Cpp\bin

To add C:\Dev-Cpp\bin and C:\Dev-Cpp to your PATH environment variable: Windows XP, Windows 2000

  1. Start --> right click on "My Computer" --> select "Properties" from the menu --> click on "Advanced" tab --> "Environment Variables" tab near the bottom --> click on "Path" in the "System Variables" window panel near the bottom -> click on the "Edit" button.
  2. VERY IMPORTANT: Press the "End" key on your keyboard to go to the end of what is already on your PATH. Do not delete the existing content of your PATH variable. If you accidentally do so, click "Cancel", and press "Edit" again.
  3. Add the following at the end of what is already the value of the PATH variable:
    For example, after I have done that, my PATH variable looks something like this:
  4. Click all three "OK" buttons to close all the windows that you have opened.

To add C:\Dev-Cpp\bin and C:\Dev-Cpp to your PATH environment variable: Windows 9x, Windows ME

  1. Edit C:\autoexec.bat; create it if it does not exist, using a text editor such as notepad, wordpad, edit, ...
  2. At the end of the file C:\autoexec.bat put the following:
    set PATH=%PATH%;C:\Dev-Cpp\bin;C:\Dev-Cpp
  3. I suggest adding the following line to your C:\AUTOEXEC.BAT file, so that you can conveniently edit the previous commands on the command line:
    doskey /insert > nul
  4. I also suggest adding the following as the first line in your C:\AUTOEXEC.BAT file just to reduce the text that appears on your screen while Windows 98 boots:
    @echo off
  5. Note that you have written some Bat Language
  6. Save the file
  7. Make sure that it was saved as C:\autoexec.bat and not C:\autoexec.bat.txt  This is a little bit tricky, as Microsoft software is so user friendly that it protects you from knowing what you are doing  :-)

To compile the program prog.cpp using the Dev-Cpp C++ compiler on the command line:

  1. Open a command prompt: Start -> All Programs -> Accessories -> Command Prompt
  2. Edit and save your program
  3. Type
    g++ -Wall -o prog prog.cpp
  4. Note that:
    1. -Wall is an option to the g++ command that enables all compiler warnings: always enable all warnings, so that the compiler can give you the most help
    2. -o prog is an option to the g++ command that specifies that "prog" is the name of the executable program that will be created by the compiler.
    3. The last thing on the command line is the name of the C++ source file that is input to the compiler.