www.delorie.com/djgpp/doc/ug/intro/installing-djgpp.html   search  
Guide: Installing DJGPP

OK, so you've got a directory full of ZIP files. Lots of megabytes, and no clue where to start! The first step is to decide what you want to do with djgpp - this tells you what to unzip. For each zip file, use either unzip or pkunzip -d to extract the files. If you forget the -d for pkzip, all the files will be in one directory, which is not what you want.

Once you select the zips you want (see the help below), you should unzip them all in the same directory. For the purposes of this Guide, we'll assume you chose C:\DJGPP (or c:/djgpp in unix parlance) as the directory. After unzipping them all, you'll see various directories:

binaries (programs)
include files
lists of what's in each zip
timezone definitions (deleteable if you don't need them)

You might also have these:

djgpp sources
gnu sources
contributed toolkits

Now that you've got everything unzipped, there are two things you have to do to prepare your system to use djgpp:

  1. Inside the djgpp directory there is a bin directory with all the programs in it. You must modify your PATH environment variable so that this directory is included. An example line in your AUTOEXEC.BAT file would looks like this:
  2. Inside the djgpp directory is a file called djgpp.env. Don't modify it unless a package tells you to do so! You must add a new environment variable DJGPP that refers to this file:
    set DJGPP=c:/djgpp/djgpp.env
    Note that you can use upper or lower case here, and either forward (unix) or backward (dos) slashes. (Most DJGPP programs support both styles of slashes; however, being Unix ports, they might sometimes support forward slashes better. When in doubt, try forward slashes, like the example.)

This next section lists the most popular (or most often forgotten) parts of DJGPP to install. Your distribution probably contains lots of other zips (when I wrote this, there were 106 separate zips!). Most of them have documentation explaining about themselves, so go poking around and see what you've got.

Basic Functionality

Everyone should install these, whether they need them or not. Why? Because it may not be obvious that you need it, but they're commonly referred to on the newsgroup. Also, note that the version you have may have newer version numbers in the file name; just use the newer file if that's the case.

Everyone should read this file. It includes important information that is as up-to-date as the zips, including a brief getting started section.

You need this. This is the basic runtime and development package, and includes such things as the include files, C libraries, standard utilities, FPU emulator, and timezone definition files.

The frequently asked questions file. Before you ask anyone else, read the FAQ!

This includes the info.exe program, which lets you read the online documentation. Run "info" to start the online document system.

This is the C compiler. It also includes the pre-processor, which many other languages use, and the GNU compiler support library, which nearly all programs will need.

This is the assembler and linker, and a few other programs (like the librarian). You'll need these for all languages.

Make is a program that keeps track of how to build your programs in the least number of required steps. Not everyone uses it, but it's strongly recommended.

You'll need this if you're running under plain DOS. DJGPP requires a DPMI server. Windows, OS/2, and Linux provide one, as does QDPMI and 386MAX. If you have none of these, get this file, which includes cwsdpmi.exe - our own free DPMI server.

Other Languages

The basic functionality allows you to write C programs, but DJGPP supports much more than that.

Bison is a yacc replacement. You'll need this to compile language grammars (*.y).

Flex is a lex replacement. You'll need this to compile lexical parsers (*.l).

Pascal compiler.

C++ compiler.

C++ libraries. You'll need these if you use streams, the GNU class library, etc.

Objective C compiler.

Programming Utilities and Helpers

These zips contain programs that will help you write your source, or port existing packages from unix.

This is an Integrated Development Environment, which combines editor, compiler, online help, and debugger all in one easy to use interface. It's probably the best place to start if you're new to command-line compilers.

GNU Emacs. This is the preferred text editor for many hard-core Unix programmers. You can also invoke the compiler or make from within, as well as read the online documentation and play games. You'll need to install all these zips; read the emacs.README first.

The GNU debugger. This is an extremely powerful full symbolic debugger, but you'd best read the docs before trying to use it.

Bash is GNU's ``bourne-again shell'', a replacement for the popular /bin/sh and Korn shell. You'll need this for some unix programs that have shell scripts; some people use it as their default shell instead of COMMAND.COM.

Ports of Unix programs

GNU Fileutils, including ls, rm, cp, mv, and others. Highlights of the latest port: ls supports colorization of files (like on Linux), ln -s knows about DJGPP-style "symlinks" (see symlink feature of DJGPP in the FAQ), install -s will strip executables on the fly, and all the utilities support long filenames on Windows 9x and numbered backups (even on plain DOS). This package is a must if you want to run Unix shell scripts, as they use some of these utilities a lot.

GNU Shell utilities. A must if you use the port of bash or want to run Unix Makefiles, but some utilities (such as env or test) can also be very useful on their own right.

GNU Textutils. Includes many useful programs, such as sort, wc, cat, join, paste, od, and uniq. Unix shell scripts and Makefiles call some of these a lot, so you should install this package if you run them.

The GNU compression utilities, gunzip, gzcat, and gzip

GNU Diffutils (diff, cmp, diff3, sdiff), and their docs. If you need to submit patches or changes to DJGPP or GNU sources, you will need the GNU diff program from this package.

GNU sed (a stream editor) program and its docs. Many ported packages require it during the build process on MSDOS.

GNU grep package and its docs. You need this if you use emacs (which has commands that invoke grep) or if you want to run Unix shells and Makefiles.

GNU find allows you to locate files on your hard drive and do interesting things with them (bigram code find frcode locate xargs)

GNU awk

GNU less

GNU patch program and docs. Required to apply patches to DJGPP sources.


These zips contain various libraries of pre-compiled functions. You don't need these, but they can speed up program development if one of them does something useful for you.

Allegro is a game library, including sound, joystick, mouse, and video routines. Very popular.

This module lets you compile programs that use Borland's graphics functions. You'll need grx also.

DJGPP's base graphics library.

A textual user interface kit.

Public Domain Curses emulation, for porting Unix programs.

Use this to write Win95 and WinNT programs with DJGPP.

For porting TurboVision programs.

C++ GUI that provides a NeXT-like windowing interface.


Nearly all the zips include a second zip that has the sources in it. For zips that end in b.zip, the sources are in a corresponding s.zip. Some exceptions are listed here.

Sources to DJGPP's C library, core utilities, and runtime support. If you have the disk space, it's worth it to download and install these for two reasons. First, they're a good learning resource. Second, you can fix bugs if you find them.

Sources for programs that are used to test the C library; not general purpose test programs but they to demostrate much of the functionality.

  webmaster     delorie software   privacy  
  Copyright © 1997     Updated Jul 1997