GNU-WIN32
Here you can find some tips - without any warranty - about how to use GNU-WIN32 (or CygWin) and how to port some parts of DirectX (and other MS' SDKs) to GNU-WIN32.
GNU-WIN32 is a port of GCC compiler to MS Windows NT/9x platform. With it, will be possible develop applications using Windows and UNIX APIs under Windows enviroment (GNU-WIN32 implement the UNIX API). Now, (05/20/1998) the current available version is beta 19.
GNU-WIN32 and MS files convensions are not the same: the library and header files have some diferences. That's why it's impossible use directly any MS' SDK (software development kit) without some hacking.
- to get more info about GNU-WIN32, and download it, go to http://www.cygnus.com/misc/gnu-win32/
- to compile Windows apps with GNU-WIN32 you need the Windows header files and optionaly a resource compiler. I don't know with GNU-WIN32 b19 came with all of this. I find them in RSXNTDJ, this stuff is a package that enable DJGPP (another port of GCC - for DOS) to compile Windows applications. Download RSXNTDJ from:
ftp://ftp.uni-bielefeld.de
or
ftp://hermes.hrz.uni-bielefeld.de
directory:
/pub/systems/ms-dos/misc
More information about RSXNTDJ and DJGPP on: http://www.delorie.com
There are other resource compilers available, but none (including the found on RSXNTDJ) compile all resources completely well (specialy dialog boxes for Win NT).
Sure: if your application does not need resources, you don't need a resource compiler.
Atention: on my system, GNU-WIN32 is installed on:
d:\des\cygnus
My enviroment variables are:
PATH=C:\ADM\WINDOWS;C:\ADM\WINDOWS\COMMAND;d:\des\bin;c:\adm\util;d:\des\cygnus\b19\H-i386-cygwin32\bin;d:\lixo;D:\APL\POVRAY
set GCC_EXEC_PREFIX=d:\des\cygnus\b19\H-i386-cygwin32\lib\gcc-lib\
SET LIBRARY_PATH=D:\des\djdes\RSXNTDJ\INCLUDE\MSSDK;D:\des\djdes\RSXNTDJ\INCLUDE\WIN32;d:\des\cygnus\b19\H-i386-cygwin32\lib;d:\des\cygnus\b19\H-i386-cygwin32\lib;
SET C_INCLUDE_PATH=D:\des\djdes\RSXNTDJ\INCLUDE\MSSDK;D:\des\djdes\RSXNTDJ\INCLUDE\WIN32;
SET CPLUS_INCLUDE_PATH=%C_INCLUDE_PATH%
SET INCLUDE=D:\des\djdes\RSXNTDJ\INCLUDE\MSSDK;D:\des\djdes\RSXNTDJ\INCLUDE\WIN32;
If you don't have enough enviroment space for all of this variables go to Properties on the MS-DOS Prompt and set on Memory -> Initial Enviroment -> 4096.
This instructions are usefull for the conversion of other MS' SDKs, but I will focus DirectX 5.0.
The hard part of enable some MS' SDK in GNU-WIN32 is convert the header files. Some diferences are:
- unions need a tag on GCC
MS stile:
GCC/GNU-WIN32 stile:
- replace
by
If you know more diferences tell me ([email protected]).
I download the needed DX header files from Stefan's site:
http://wwwswt.informatik.uni-rostock.de/~knorr/dxfiles/examples.html
Go and get directx.zip and mmsystem.zip.
Copy the header files to:
d:\des\cygnus\b19\H-i386-cygwin32\i386-cygwin32\include
About the library files:
MS library files (extension *.LIB) are incompatible with GNU-WIN32 library files (extension *.A).
You can download some of the DirectX 5.0 library files, for GNU-WIN32 b19, from here:
dx5cyg.zip - (4kb) DDraw and D3DRM
To use the files, copy them to:
d:\des\cygnus\b19\H-i386-cygwin32\i386-cygwin32\lib
I supose you want to convert DirectDraw LIB file, for other LIBs use the same procedures.
- Copy the source *.LIB and source *.DLL for one directory where the conversion will be made.
Example: ddraw.lib and ddraw.dll
In true, for DirectDraw, the library file is used only to enable the application to use the ddraw.DLL. (?)
You will find the DLL on the Windows dirs.
Try convert the LIB to A using the Stefan's
makefile.
If you have problems using it, make the commands
separately: - use NM to get the ddraw.lib description (NM comes with GNU-WIN32). Example: nm ddraw.lib > ddraw.nm - Create the ddraw.def file. For this, go to Linux and run the example: cat ddraw.nm | egrep '^........ [T]' | sed 's/[^_]*_//'
>> ddraw.def Or, you can make the ddraw.def manualy: Open the ddraw.nm in one text editor and search each line
with the char 'T' in second row. For example: Create a file with the copy of the lines with the 'T' char (without the first
understore). Final result: - add a new line on the begining with the word EXPORTS - Create the ddraw.a, as the example (dlltool comes with GNU-WIN32): - To test the DirectX *.A files, use the Stefan's examples (in true doesn't need Mingw32). - Try Mingw32
- this is a package that make unecessary the big DLL that come with GNU-WIN32 apps, disabling
the UNIX API. On the site you will find, too, tutorials and
code demonstrating how to compile Windows apps with GNU-WIN32. - Other links:
More Information