Node:Installing GPC on DJGPP, Next:DJGPP Info reader, Previous:DJGPP download, Up:GPC on DJGPP

#### How do I install the compiler?

If you don't have DJGPP installed on your harddisk, create a directory for GNU Pascal (`c:\gpc`), and unzip the archives. Make sure you preserve the directory structure (use `pkunzip -d`). Now, add the directory where `gpc.exe` lives (`c:\gpc\bin`) to your path and set the DJGPP environment variable to point to your `djgpp.env` file:

    set DJGPP=c:\gpc\djgpp.env

Then, add this to your `djgpp.env` file:

    ---------------------------------------------------------
    [gpcpp]
    C_INCLUDE_PATH=%/>;C_INCLUDE_PATH%%DJDIR%/lang/pascal;%DJDIR%/include

    [gpc]
    COMPILER_PATH=%/>;COMPILER_PATH%%DJDIR%/bin
    LIBRARY_PATH=%/>;LIBRARY_PATH%%DJDIR%/lib;%DJDIR%/contrib/grx20/lib
    ---------------------------------------------------------

The binary distribution should come with a `djgpp.env` which is already modified, so you may not have to do this.

The GPC online documentation is in GNU info format; you need the Info reader (`txi390b.zip`) to read it, or use the built-in Info reader of the RHIDE or PENG IDE. To add the GPC documentation to the info directory file, edit the `c:\gpc\info\dir` file, and locate this section:

    ---------------------------------------------------------
    * GCC: (gcc.inf).
    The GNU C, C++, and Objective-C Compiler

    * GDB: (gdb.inf).
    The GNU Debugger (gdb and gdb-dpmi).

    ---------------------------------------------------------

To add GPC, change it to look like this:

    ---------------------------------------------------------
    * GCC: (gcc.inf).
    The GNU C, C++, and Objective-C Compiler

    * GPC: (gpc.inf).
    The GNU Pascal Compiler

    * GDB: (gdb.inf).
    The GNU Debugger (gdb and gdb-dpmi).

    ---------------------------------------------------------

Specific information for low-memory conditions and more can be found in the DJGPP FAQ and documentation.