DJGPP


Introduction

This can be a pretty frustrating compiler to work with. A lot of times you'll run into a problem using it and it seems that you can't find the answer. At that point you have two choices: 1.) ask somebody and be berated for not reading through the mounds of documentation (sometimes you feel like a nut), 2.) read through the mounds of documentation (sometimes you don't).

It's actually a DOS port of GNU C/C++. The specific nuances of it will be here, but for further syntax and shiet, see GNU C/C++.

This document covers DJGPP version 2+, not version 1.

Obtainment

You can download DJGPP for free from one of a gazillion million FTP sites that mirror SimTel. It is divided into many many seperate files that each give DJGPP some different kind of functionality. Each file is a zip file that ends with a number and a letter. The number indicates the version of the module and the letter is the contents of the zip file:

bbinary release of the module
ssource code of the module

In the absence of a letter, the zip file will usually contain source code. Since we'll be using DJGPP and not modifying it's source code, you'll want to only download files that end with "b".

The files are also divided into one of five directories:

v2Core files specific to DJGPP alone (not GNU)
v2apps* Programs built for DJGPP
v2gnuPorts of GNU software to DJGPP
v2misc* Miscelaneous DJGPP stuff
v2tk* ToolKits for DJGPP
* = not required for basic installation

You should always get the most recent version of the files unless they are still in a testing (alpha or beta) stage. For basic installation, you'll need to download the following files:

v2
djcrxCross-to-DOS Compiler Kit
djdevDevelopment Kit and Runtime

v2gnu
bnuGNU Binary Utilities
gccGCC Compiler
gppGCC C++ Headers and Libraries

I've gotten these files for you and put them into a single zip file. It includes djcrx 2.03, djdev 2.03, bnu 2.95.1, gcc 2.95.2, and gpp 2.95.2.

Installation

These are step by step instructions for installing the bare minimum of DJGPP. I know you don't want to spend all day downloading, which is why I did it this way. When the time comes you'll need to add some additional modules to DJGPP for extra support, but this will work for the time being. These instructions also have you install DJGPP to C:\.

  1. Download the single zip file I've put together to the location C:\.

  2. Make sure you're in the root directory of C:\. If you aren't or you don't know how to get there, type the following:

    c: [enter]
    cd\ [enter]

  3. Unzip the file djgpp.zip. Make sure you unzip with directories. If you don't have an unzip program or don't know how to do this: download UnZip32.exe to C:\ and then type:

    unzip32 djgpp.zip [enter]

    That will extract all the files from djgpp.zip.

  4. Open up the file C:\AUTOEXEC.BAT in a text editor. You can do this by typing:

    edit autoexec.bat

  5. Type the following at the very beginning of the file:

    SET djgpp=c:\djgpp\djgpp.env [enter]

  6. Restart your computer.

  7. Now at the prompt, type:

    gcc -v

    This should give you the output:

    Reading specs from c:/djgpp/lib/gcc-lib/djgpp/2.952/specs
    gcc version 2.95.2 19991024 (release)


    If it doesn't, you'll either need to try and divulge the problem yourself or you can send me an email and explain things.

Build Program: From Single File

See GNU C/C++.

Links

DJGPP Official Homepage