Dev-C++ 4.9.9.0
and 4.9.9.1
Setup Notes
by Charles F. Monroe
September 28, 2002
Updated December 19, 2004
Disclaimer: These notes describe now I setup
Dev-C++ 4.9.9.0 in my classroom at Heritage High School. We have
25 computers in an isolated LAN, each is a 2.8 GHz Pentium-III, running
Windows XP Pro SP1. The LAN is isolated for security reasons, meaning
it is presently not connected to the Internet or even to the rest of the
school network. I do not guarantee that these procedures will work
on your computer or network setup.
Now that C++ is no longer the language of Advanced
Placement Computer Science, we no longer use AP Classes. We use standard
C++ language features instead.
Contents:
-
Initial installation
-
Borland BGI Graphics simulation using winbgim.h
Initial installation
-
I first installed Dev-C++ 4.9.9.0 onto each computer in my lab by downloading
the free installation program, copying it to a folder on one of the computers
on my isolated Lan, and sharing that folder, setting permissions simply
to allow all uses to read the contents of the folder. I then installed
Dev-C++ onto each omputer.
-
Students installing Dev-C++ at home, just download the installation program
and follow the steps below to setting up one computer.
-
Teachers installing Dev-C++ on a lab of computers that are networked might
like to try my method in order to save time and energy. Otherwise,
the full installation procedure will need to be performed for each computer.
-
Installing Dev-C++ 4.9.9.0 on one computer
-
Run the setup program.
-
BE SURE to use the default directory for installation (C:\dev-cpp).
If you insist on using a different directory, BE SURE to use a directory
path that DOES NOT CONTAIN SPACES in the pathname (this means you can't
use a subdirectory of C:\Program Files). Otherwise, your good C++
programs will not compile or run and you will wonder why. Spaces
in pathnames to your project and source code files don't seem to matter.
-
Run Dev-C++. The first time you run it, it will ask you for your
language. I chose English.
-
Set the default user directory.
-
Under Tools | Environment Options, click the Files & Directories tab.
-
In the "User's Default Directory" field, either type the path you wish
(you or your students) to use by default, or use the browser (ellipsis)
button to find it.
-
My students all use "K:\cpp" so that's what I typed.
-
Leave all other defaults "as is".
-
Click the Ok button.
-
Lastly, set up the application startup documents the way you want them.
Otherwise, every time you start a new project, you'll get default file
that contains Dev-C++'s choice--which may be fine, but may not be the best
suited for high school students learning C++. In our class, we only
use C++ Console Applications, so that's the only startup document I have
re-designed.
-
To change a startup document, find the appropriate text file located in
the Templates directory under C:\Dev-Cpp. For C++ Console Applications,
we would choose "ConsoleApp_cpp.txt". This file can be edited with
Notepad for any other text editor (NOT a word processor, so DO NOT use
Word or Works, etc.)
-
This is the contents ConsoleApp_cpp.txt
that I came up with.
-
There is one more optional step. You may wish, at this time, to go
ahead and set things up for BGI graphics with console applications.
To do this, also include the steps below under How
to add a new C++ Console Application with Graphics template to Dev-C++.
-
The next step is to setup Dev-C++ on the remaining computers on your network.
-
Perform an initial install on each computer.
-
Copy the following files from your first computer (with all the new setup
information) to each of the additional computers. You can use a floppy,
or do it across the network. I used a batch file to automate the
process and had the files copied in no time.
-
C:\Dev-Cpp\devcpp.ini
-
C:\Dev-Cpp\Templates\*.*
(and if you installed the BGI graphics files:)
-
C:\Dev-Cpp\include\conio.h
-
C:\Dev-Cpp\include\winbgim.h
-
C:\Dev-Cpp\lib\libbgi.a
-
C:\Dev-Cpp\lib\libconio.a
Borland BGI Graphics
Thanks to the work of the Russian mathematician and computer scientist
Konstantin
Knizhnik, and Mark Richardson and Michael Main of the University
of Colorado, and recent modifications
by Adrian Sandor we now have four wonderful files that enable us to
use the graphics commands originally implemented by Borland in their classic
IDE/compiler Turbo C++. Please note that the winbgim.cpp file
used by Sandor (and therefore quite possibly Knizhnik, Richardson, and
Main) seemed to contain an error in the ellipse and sector drawing routines
that caused elliptical arcs with angles that started or ended in the second
or fourth quadrants to be misdrawn. I have fixed that error and recompiled
winbgim.h and winbgim.cpp into libbgi.a so that the new library draws elliptical
arcs correctly. I used the same compiler settings as Sandor.
All source code, old and new, is here.
These 4 files, provided here in winbgim_devcpp4990_20041220.zip,
are
-
winbgim.h (place in C:\Dev-Cpp\include)
-
conio.h (place in C:\Dev-Cpp\include)
-
libbgi.a (place in C:\Dev-Cpp\lib)
-
libconio.a (place in C:\Dev-Cpp\lib)
Download and unzip the four files, placing each in the directory indicated.
If you installed Dev-C++ in a directory other than C:\Dev-Cpp, use that
instead. If you have older versions of any of the files, delete,
overwrite, rename, or remove the older versions. The older versions
are no longer useful for versions 4.9.9.0 or later of Dev-Cpp.
Once these four files are installed, there are two more steps to use
the BGI graphics routines.
-
#include "winbgim.h"
-
Add these linker options to the project: -lbgi -lgdi32 -luser32
-
To do this, click the Project Options icon (or, Project | Project Options
from the menu).
-
Then click the Parameters tab.
-

-
Type the linker options in the Linker text field:
-lbgi -lgdi32 -luser32
note: those are lower case letters L, not the number 1
-
Click the Ok button.
This two-step procedure must be followed every time you start a C++ Console
Application in which you use BGI graphics--UNLESS you add the following
to your Dev-C++ configuration:
How to add a new C++ Console Application
with Graphics template to Dev-C++
-
In the C:\Dev-Cpp\Templates directory, make a copy of the file named "2-ConsoleApp.template"
and rename it to "6-ConsoleAppGraphics.template"
-
Using a text editor (such as notepad) make the following changes to the
new file:
-
In the [Template] section, change
Name=Console Application
to
Name=Console Graphics Application
-
In the same [Template] section, change
Description=A console application (MSDOS window)
to
Description=A console application (MSDOS
window) with graphics
-
In the [Unit0] section, change
Cpp=consoleapp_cpp.txt
to
Cpp=consoleapp_cpp_gr.txt
-
In the [Project] section, add the following line
Linker=-lbgi -lgdi32 -luser32
note: those are lower case letters L, not the number 1
-
In the same directory, create a file named "consoleapp_cpp_gr.txt" and
place in it a sample, introductory BGI graphics program, which will be
the startup file for every C++ Console Application with Graphics.
Here is a sample.
After completing the above,
-
You can copy your two new files to the corresponding directory of every
other computer with Dev-C++ in your lab.
-
You can then easily start a new C++ Console Application with Graphics whenever
you start a new project by simply choosing the new, sixth application template
which you have created:
-
