I think the installation issues regarding various systems, including usage, have been explained clearly. Why are there still so many questions?????????????????
=============================================
DJ Delorie
This is the README.1ST file for DJGPP Version 2.03
This is the Chinese version of the README.1ST file for DJGPP Version 2.03
(This is the README.1ST file for DJGPP Version 2.03 in Chinese Edition)
This file was translated and cataloged by LEMONHALL in July 2003
The email is lemonhall@vip.sina.com
The QQ number is 313813. Welcome to correct errors.
Copyright@1989-1999 DJ Delorie All rights reserved
Chinese (in simplified character only) translation rights
arranged with DJ Delorie
Table of Contents
Distribution Package
Getting Started
What to Download
Installation
Compilation
Development Environment
Debugging
Online Documentation
Reading Online Documentation, Using Info
Compatibility with Version 2.00
Compatibility with Version 1.x
Copyright
************************************************************************
* This file contains information on obtaining, installing, and using *
* This file contains information on obtaining, installing, and using DJGPP. Please read it *completely* before asking for help. *
* DJGPP. Please read it *completely* before asking for help. *
* again. *
************************************************************************
DJGPP is a royalty-free environment for developing 32-bit protected mode software under MS-DOS. The homepage of DJGPP on the World Wide Web is:
http://www.delorie.com/djgpp/
Software status and other information (online documentation, FAQs, mailing lists) can be viewed through the web page. Discussions about DJGPP and some questions about its use or features can be participated in through newsgroups (sent to comp.os.msdos.djgpp) and the DJGPP mailing list (send emails to ). Also, please pay attention to the various latest development packages of DJGPP on the website.
Information about the version is marked in the *.ver file in the root directory of each compressed package, and the content is marked in the *.mft file in the root directory of each compressed package.
Of course, users can also obtain interactive (usually better) tutorials on installing and using djgpp on the World Wide Web:
http://www.delorie.com/djgpp/doc/
Distribution Package
****************
The DJGPP distribution package contains many subdirectories divided by content, and there is a file called 00_index.txt in each subdirectory to describe the files in the directory.
Compressed packages ending with 'b' contain compiled binary files and online documentation. At the moment of writing this description, these packages are:
FAQ A file that guides you which other documents to read (itself also includes a comprehensive FAQ list)
v2/
unzip32 A free tool to extract ZIP files (like PKUNZIP)
djdev203 DJGPP V2 development package and dynamic link library required for runtime
djlsr203 DJGPP V2 basic library source code
djtst203 DJGPP V2 test program (only used to test the C library)
djcrx203 DJGPP V2 DOS compiler support file package
djtzn203 DJGPP V2 time zone file
djtzs203 DJGPP V2 time zone source code
faq*b All FAQ lists (written in various formats, Info, ASCII, HTML...)
faq*s The Texinfo sources of the FAQ and tools to generate all different formats of the FAQ
frfaq* French DJGPP FAQ
v2apps/
(Collection of various programs that cooperate or work for DJGPP, like RHIDE, TeX)
v2gnu/
(Interface to work with various FSF/GNU programs, such as gcc and binutils)
v2tk/
(Various development tools, development libraries, such as Allegro and libsocket)
v2misc/
csdpmi* CWSDPMI, Charles Sandmann's free DPMI service program and instructions
mlp* ML executable file packer
pmode* PMODE stub for djgpp V2
wmemu* Optional 387 emulator for WM
(There are many miscellaneous tools for DJGPP)
Getting Started
***************
The following information is for users with minimum requirements, introducing how to get started quickly. Of course, for a new user, we hope and encourage you to get more detailed information by actively reading the FAQ list.
What to Download
----------------
You can see a form-based description at http://www.delorie.com/djgpp/zip-picker.html, which lists in detail the distribution packages you need to download. Usually, users do not need source files, so if you just use DJGPP, it is enough to download the binary package.
To compile a C program, you need to download djdev203.zip, gcc*b.zip, and bnu*b.zip. If you need to use C++, you also need to download gpp*b.zip.
If you need to find online manuals, you need to download txi*b.zip and run the tool "info". If you use pure 16-bit DOS, you need to install a DPMI service program. The installation package is csdpmi*b.zip (Windows, QDPMI, 386Max, NWDOS, OpenDOS, OS/2, Win/NT and DOSEmu under Linux have provided good DPMI services, so installing and running DJGPP in these environments does not require CWSDPMI). For detailed information, please refer to Chapter 4 of the FAQ list (download faq*b.zip and make sure it is a complete FAQ list) - "Where and What to Downlaod (Where and What to Download)".
If you use Windows ME, 2000 or XP, the mirror files before November 2001 may not work normally. So if you use the above operating systems to run DJGPP, make sure you download the latest distribution package.
Installation
------------
1. Create a DJGPP working directory, for example, C:\DJGPP. (Warning: Do not install DJGPP in directories or subdirectories such as C:\DEV, D:\DEV: that will cause it not to work. For detailed reasons, see the FAQ list). Do not use long directory names or any special characters, such as spaces.
If you have installed version 1.x before, it is best to give up using it or simply delete them. Of course, you can also just move them to other directories, but make sure that the target directory of the move does not appear in your PATH environment variable. (According to investigations, some bug reports are caused by mixing two versions of DJGPP. In fact, the only file that can be retained in version 1.x is 'go32.exe'

.
If you use Windows NT 4.0 to run DJGPP, before installation, you need to decide whether you want to use long file names or only use the DOS 8.3 file name format. If long file name support is required, you need to download and install the TSR driver package (ntlfn*b.zip) before extracting the DJGPP distribution package.
(Translator's note: It is recommended not to use WinNT 4.0 to run DJGPP)
2. Unzip all compressed packages and keep the directory structure. For example:
pkunzip -d djdev203
or
unzip32 djdev203
In Windows 9x, Windows/ME, Windows 2000 and Windows XP, use the unzip tool that supports long file names. The latest InfoZip's UnZip, PKUnzip and WinZip can all support long file names. The unzip32.exe on the DJGPP site can also support long file names very well. A method to ensure that you correctly extract long file name files is to check include/sys/sysmacros.h: if you only see sysmacro.h, then your unzip tool does not support long file names, and you need to find another unzip tool that really supports it.
You must ensure that the directory structure is correctly retained when extracting. If you use WinZip, check the checkbox "Use folder names". If you use pkunzip, make sure you use the -d parameter switch.
In Windows/NT (NT version 4 or lower, not WIN2000), if the TSR long file name driver LFN is not mounted, unzip will not correctly extract long file name files, and DJGPP cannot access long file name files. So here, we recommend using unzip32.exe, which will extract correctly.
3. After correct extraction, set the environment variable to point to the DJGPP.ENV file in the DJGPP installation directory and add the BIN directory of DJGPP to the PATH environment variable queue.
The exact method to set the environment variable depends on the operating system you use:
* For Windows 98 system:
- Click Start;
- Select Program->Settings->System Tools->System Information;
- Click the tool on the menu bar and select "System Configuration";
- Edit AUTOEXEC.BAT as follows
* For Windows ME system:
- Click Start, select Run, enter msconfig.exe; click OK
- Click the "Environment" page;
- Edit the PATH system variable to add the bin subdirectory of DJGPP;
- Add a new variable DJGPP and set its value to the full path name of DJGPP.ENV.
(More detailed introduction follows)
* For Windows NT system:
- Right-click "My Computer" and select "Properties";
- Click the Environment page;
- Edit the PATH system variable to add the bin subdirectory of DJGPP;
(If you are not an administrator, add the bin directory to the current user's PATH variable)
- Add a new variable DJGPP and set its value to the full path name of DJGPP.ENV.
(More detailed introduction follows)
* For Windows 2000 or Windows XP system:
- Right-click "My Computer" and select "Properties";
- Click the Advanced page; then click the "Environment Variables" button
- Edit the PATH system variable to add the bin subdirectory of DJGPP;
(If you are not an administrator, add the bin directory to the current user's PATH variable)
- Add a new variable DJGPP and set its value to the full path name of DJGPP.ENV.
(More detailed introduction follows)
* For other systems (DOS, Windows 3.x and Windows 95): Use the standard EDIT program to edit AUTOEXEC.BAT in the root directory of the boot disk.
As an alternative to editing AUTOEXEC or global variables, you may want to create a shortcut for DJGPP. If you do this, you need to create a batch file (*.bat) and include the commands introduced below. This approach is suitable for computers with multiple compilation systems installed.
In any case, we assume that you have installed DJGPP in the C:\DJGPP directory, so the commands to set the two environment variables are as follows:
set DJGPP=C:\DJGPP\DJGPP.ENV
set PATH=C:\DJGPP\BIN;%PATH%
4. Restart. This can enable the two commands (in Windows NT, Windows 2000 and Windows XP, the environment variables take effect immediately, so if you use the above systems, you do not need to restart. But you still need to close the running DOS window and then run a new DOS window again)
5. Run the program go32-v2.exe without any parameters:
go32-v2
It will report the size of the DPMI memory and virtual space (swap) available for DJGPP, like this:
DPMI memory available: 8020 Kb
DPMI swap space available: 39413 Kb
The exact numbers depend on how much physical memory you have installed, how much hard disk space there is, and the capabilities of the DPMI service program. However, if the sum of the two spaces reported by go32-v2 is less than 4MB, please read section 3.9 of the FAQ list. "How to configure your system for DJGPP" (How to configure your system for DJGPP) (If you want to optimize the operation when it is already greater than 8MB, you can also refer to this part of the FAQ)
Compilation
-----------
GCC is a command-line-based compiler that can be used on the DOS command line. You can use the following command to compile and link a single C program source file:
gcc myfile.c -o myfile.exe -lm
The -lm parameter requires the compiler to link with the lib/libm.a library (trigonometric functions). (Linking requires explicit declaration. This means that if you need to use libm.a, you must add the parameter '-lm' at the end of the command line when compiling)
Use the following command to compile C or C++ source code into an OBJ file:
gcc -c -Wall myfile.c (for C source)
or
gcc -c -Wall myfile.cc (for C++ source)
This compiles the file myfile.o. The parameter switch `-Wall' turns on the warning mode of the GCC compiler, and these warning messages are very useful for new users. (GCC also supports many other extensions, such as .cpp. For these, please refer to section 8.4 of the FAQ "How does GCC recognize the source language"
Use the following command line to compile multiple object files (OBJ) into an executable file:
gcc -o myprog.exe mymain.o mysub1.o mysub2.o
This compiles the executable file `myprog.exe' under DOS.
You can link a C++ program like this:
gxx -o myprog.exe mymain.o mysub1.o mysub2.o
At this time, the program will automatically search for the C++ library, so you don't have to worry about setting parameters related to the C++ library like above.
You can also perform these two steps of compilation and linking together:
gcc -Wall -o myprog.exe mymain.c mysub1.c mysub2.c
For more information about GCC running parameters, please refer to the online documentation. Before reading, you must confirm whether the Texinfo online documentation reading tool is correctly installed. (Find txi*b.zip and read the section about online documentation below)
After successful installation, you can find relevant information like this:
info gcc invoking
Development Environment (aka IDE)
---------------------------------
Indeed, DJGPP does not have its own integrated environment. But this also means that you can freely choose any editor that can run DOS programs and view the output after running as an IDE. Many programmers use a DOS-based GNU Emacs to work with DJGPP. (You can find it in the v2gnu subdirectory) Emacs is a very powerful editor (for example, it has a built-in Info reading function, so you can read DJGPP's online documentation without exiting the editor), and many other free editors can also be used as IDEs. The only thing that these quasi-IDEs (including Emacs) cannot do is perform full-screen debugging.
An IDE called RHIDE, exclusive to DJGPP, was recently released to all DJGPP users. It has a Turbo C-style IDE interface, automatic indentation, statement coloring, statement highlighting, automatic call to DJGPP compiler, automatic generation of Makefile, and convenient reading of online documentation. And more excitingly, RHIDE also integrates a highly integrated debugging environment as powerful as the GNU Debugger (gdb). Because RHIDE is still a new software, there are still many bugs waiting to be debugged. So if you are interested, please visit:
http://www.tu-chemnitz.de/~sho/rho/rhide.html
to get the latest information.
(Translator's note: RIHID has become a widely used tool kit. It is recommended that everyone download and master its use)
Debugging
---------
If you need to debug the program, you must add the parameter switch `-g' when compiling:
gcc -c -Wall -g mymain.c
gcc -c -Wall -g mysub1.c
gcc -c -Wall -g mysub2.c
Of course, you can also add the parameter `-g' when linking:
gcc -g -o myprog.exe mymain.o mysub1.o mysub2.o
(Note: When using DJGPP v2.01 version, there is no need to output the program as COFF for debugging. (Omit the `.exe' suffix in the file name to achieve this purpose). The debuggers of version 2.01 and later versions are fully capable of directly reading executable files for debugging, just like debugging COFF format files. Of course, if you can't fully understand what this means, don't worry.)
Then run your program under the debugger:
fsdb myprog.exe
or
gdb myprog.exe
or
edebug32 myprog.exe
(If you want to use GDB to debug the program, then you need to download gdb*b.zip)
FSDB has its own help screen, and you can press F1 to call the help. The help file of GDB can only be read using Info. Edebug32 is a rarely used integrated debugger, and press 'h' to call the help after running.