DJGPP Installation
People ask a lot of questions about DJGPP installation / setup instructions. Actually, installing DJGPP isn't hard at all.
First of all, you need to get the right files. You can find them using the zip picker here or the one on DJ Delorie's site. Note that the zip-picker on my site isn't as regularly maintained as that of DJ Delorie's. Check the files you need and download them from your favourite Simtelnet mirror. Please go through the document README.1ST that comes with DJGPP. It is the authoritative source of information regarding the DJGPP installation.
You'll need to have at least the following files:
where "*" can be any number.
In addition to this, it is highly recommended to have the following packages as well.
Now, you must first create a directory where you wish to install DJGPP. Usually, C:\DJGPP is used.
Note: Never install DJGPP in a directory called "dev" from the root (ex: c:\dev). It will refuse to work since /dev has a special significance in DJGPP.
To create the directory, do the following at the MS-DOS prompt.
c:
cd \
md djgpp
Change to the DJGPP directory now.
cd djgpp
After this, you need to install the packages you downloaded. This is perhaps the most important stage of installation.
If you are using unzip32, then you have nothing much to worry. Simply type
unzip32 package.zip
for each of the zip files that you downloaded replacing the name "package.zip" with the actual name of the zip file.
If you are working on plain DOS (not MS-DOS prompt in Windows) or Windows NT (not Win 9x), and you do not have unzip32, then do this:
pkunzip -d package.zip
for each of the zip files that you downloaded replacing the name "package.zip" with the actual name of the zip file.
and install each of the packages. So effectively, you might be doing...
unzip32 djdev203.zip
unzip32 faq320b.zip
and so on...
If you are working on Windows 9x (not Windows NT), then use an LFN aware zipper such as Winzip to extract the packages into the DJGPP installation directory. Make sure that you extract with pathnames.
Finally, to complete your installation, you need to enter two lines into your autoexec.bat file. Add the lines
PATH C:\DJGPP\BIN;%PATH%
SET DJGPP=C:\DJGPP\DJGPP.ENV
to the end of autoexec.bat.
The autoexec.bat is found on C:\. To edit use the command
edit C:\AUTOEXEC.BAT
The DJGPP Frequently asked questions should be in the FAQ directory within the installation. Please make sure you read this carefully. It answers almost every question most newbies have in mind.
Reboot the machine. That completes the installation ;-). You are now ready to use DJGPP. Finally, if you are still out of luck, send E-Mail to djgpp@delorie.com and explain your problem and what you did in detail. Without details, they can't help. The djgpp@delorie.com is the gateway to comp.os.msdos.djgpp newsgroup. So remember that your E-Mail will be seen by a large group of people.
After this, you may still have a few questions...
Q. I installed DJGPP and modified my AUTOEXEC.BAT as well. But when I run "gcc" it gives me an error "Fatal: gcc installation problem" and stops. What's up?
A. You probably inserted a space between the "=" sign while modifying AUTOEXEC.BAT. The correct way to do this is shown.
SET DJGPP=C:\DJGPP\DJGPP.ENV
SET DJGPP= C:\DJGPP\DJGPP.ENV (is WRONG!)
Q. I still get the same error. What's happening? A. Your autoexec.bat probably requires a very large environment. To change the environment to a 4K, add or modify the line in CONFIG.SYS
SHELL=C:\COMMAND.COM /E:4096 /P
Make sure the path to COMMAND.COM is correct or you'll regret later on. And don't blame me if that happens...
Also remember that there is no space between the "=" sign.
Q. I finished the DJGPP installation, but how do I compile my C programs. Are there any IDEs for DJGPP?
A. You can use the command-line
gcc myprog.c -o myprog.exe
That should get you the executable. And yes, there are several IDEs. More details here.
Q. I try to compile a C++ program using the above command-line and I get an error. Is there something wrong?
A. You need to use
gpp myprog.cc -o myprog.exe
OR
gpp myprog.cpp -o myprog.exe
OR
gcc myprog.cc -o myprog.exe -lstdcxx
to compile C++ programs.
Q. I'm using RHIDE to compile my C++ programs and I get an error "ld: cannot open -lstdcxx". Now what?
A. You have an old version of RHIDE, i.e. 1.4. Unfortunately, the zip-picker points to this old version. You can get the latest version of RHIDE from Andris Pavenis' page http://www.lanet.lv/~pavenis/rhide.html. You can also try the http://www.midpec.com/djgpp/zip-picker.html zip-picker here (not that it isn't regularly maintained though).
Note: If you have any other questions regarding the installation that you did not find here, please E-Mail me (tr@midpec.com) and tell me about it. If necessary, that will be added here. Also, I'll try to help you out if I have the time.
Copyright (C) 1999-2001 Prashant TR