Mail Archives: djgpp/1996/01/07/15:28:44
> > Thanx to everyone who replied to this... I've managed to get the
> > thing working, under v1.11m4 - works great so far {=^)
>
> Could you please post a summary of the steps required to accomplish this?
> I would like to include them in the next version of the DJGPP FAQ list.
>
No probs... It's mostly straight from the help file (windows help) in
the docs/ directory of the distribution, but that was written very
haphazardly in my opinion anyway so I'll try and rewrite it here -
(you'll probably think mine's worse ...) hopefully so you'll be able
to paste it straight into the FAQ - however, I've tried to be very
thorough about possible misunderstandings - you might decide it's too
patronising for a FAQ aimed at programmers...
Ohh... I didn't mean to suggest that you shouldn't alter this text -
do whatever you want with it =) Most of it is paraphrasing from the
RSXWDK help file anyway.
BTW, it was actually maint3 I installed it under - I said 4 because I
have the maint4 release here, and just hadn't bothered unzipping it
yet.. Also, maint4 didn't seem to have any major differences when I
looked at it...
Ohh... and you might want to mention that RSXWIN is not the same
thing.. it's a sort of wrapper for the C stdio functions (EMX only?)
to let them use a Windows window (sorry) as a console instead of the
MS-DOS console - just relieves the multitasking problems that Windows
has with DOS boxes. (In case you're not familiar with it) - That had
me confused for a second...
Also, I took a few liberties for the sake of simplicity - basically,
I lied about having to put the SET commands after each other in the
AUTOEXEC.BAT, since it's pretty certain that those positions will be
safe... Anyways, like I said - feel free to hack it to bits if you
need to... {=^)
--------------------
Assuming you've got DJGPP (v1.11m4) installed and working, with the
CALL c:\djgpp\bin\setdjgpp c:\djgpp c:/djgpp
Command in your AUTOEXEC.BAT file, and the RSXWDK distribution
has been properly unzipped in C:\RSXWDK, you need to perform the
following steps.
If you have not yet installed DJGPP, install it as explained in the
DJGPP documentation, and make sure it works (you should have test
programs if you have a complete distribution - If not, see the
documentation for details of obtaining them, or simply write a
program that you are SURE is correct).
If you have installed RSXWDK in a directory other
than C:\RSXWDK, or you have installed DJGPP in a directory other than
C:\DJGPP, you'll need to subsitute your the directory names that you
have used in place of the ones I have mentioned.
1. In your AUTOEXEC.BAT file, somewhere AFTER the SETDJGPP call,
add the following:
SET C_INCLUDE_PATH=C:/DJGPP/INCLUDE;C:/RSXWDK/INCLUDE
and if you want to compile C++ programs, add the following directly
after it:
SET CPLUS_INCLUDE_PATH=
C:/DJGPP/INCLUDE;C:/DJGPP/CPLUSINC;C:/RSXWDK/INCLUDE
[Note that the above should all be on one line]
Next, you need to tell DJGPP where the new libraries for the linker
can be found - add the following directly after the above lines:
SET LIBRARY_PATH=C:/RSXWDK/LIB/LIBDJ
The final change needed in your AUTOEXEC.BAT file involves adding the
C:\RSXWDK directory to the MS-DOS search PATH. To do this, simply
look for a line starting with PATH in the file, such as:
PATH %PATH%;C:\WINDOWS;C:\DOS
If you find it, simply add:
;C:\RSXWDK
to the end of this line (do NOT add a space between the original line
and the addition above - you'll notice that there is a semi-colon at
the start of the addition - this REPLACES a space. (If the original
line already ends with a semi-colon, do NOT add another).
Continuing the example above, the completed line would look like:
PATH %PATH%;C:\WINDOWS;C:\DOS;C:\RSXWDK
If you can't find a line beginning with PATH in your AUTOEXEC.BAT
file, don't worry - some don't have it - just add the following line to the
end of your AUTOEXEC.BAT (OR - if there is a line like WIN or
C:\WINDOWS\WIN at the end of your file, add the following on the line
JUST ABOVE it)...
PATH %PATH%;C:\WINDOWS;C:\DOS;C:\RSXWDK
*************************
ELI :
NOTE that the RSXWDK docs say you can't use the DJGPP\LIB path AT
ALL - You might want to append C:/DJGPP/LIB to the end of the above
line, since the RSXWDK/LIB/LIBDJ path has no math libraries, etc.
when installed - I haven't tried this yet, but surely DJGPP will
search the library paths in the order you specify, so that all of the
RSXWDK libs would override the DJGPP ones ?
**************************
------
2. Assuming you have the windows include files from a 16 bit
compiler in C:\BORLANDC\INCLUDE, type the following commands at the
MS-DOS prompt:
cd C:\RSXWDK\INCLUDE\WIN
MAKEALL C:\BORLANDC\INCLUDE
------
3. Next, type the following to create the new linker libraries:
cd C:\RSXWDK\LIB\LIBDJ
PATLIBC C:\DJGPP\LIB
------
That's it !!!!
To compile a single file (I'll assume it's called hello.c) into a
Windows executable, you need two commands :
gcc -win -o hello.w32 hello.c
and
rsxwbind hello.w32 hello.exe
This will be quite familiar to DJGPP users, since the second command
attaches a startup file to the original executable to allow it to run
under the Windows environment.
In the first command (the compiler call), veteran DJGPP users will
notice that -win is a new option. It simply tells GCC how to make
the new type of output file needed for RSXWDK.
Note that the compiler will only be useful for writing RSXWDK *OR*
DJGPP programs with these alterations. There are batch files (.BAT files)
included in the RSXWDK distribution which will switch the compiler
into it's normal configuration, and the RSXWDK configuration. The
commands are as follows:
LIBPATH old
Will cause the compiler to revert to producing normal DJGPP DOS
executables.
LIBPATH new
Will switch the compiler back into the configuration required to
produce RSXWDK executables for Windows.
-------------------------------------------------
That's it Eli, hope it helps..
Lee.
--
Lee Braiden (lee_b AT celestia DOT dnet DOT co DOT uk)
<Celestia>
- Raw text -