This is a port of the DirectX 5.0 libraries and headers to both CYGWIN32 and Mingw32. It only works under C, as although the C++ front end has been fixed in egcs 1.1, there still remains the problem that the virtual table formats of MSVC and GCC are different, which makes things tricky. Any ideas as to how to get around this one? As the previous attempt at a port of DirectX was extremely broken and made no attempt to integrate COM, I decided to start again from scratch... Firstly I created import libraries for each of the relevant DLL files using dlltool and Colin Peters' impdef. impdef xxx.dll > xxx.def (At this point I edited the resulting .def file to add the @8, @12, etc. to the end of the relevant functions) dlltool -k --output-exp libxxx.a --dllname xxx.dll --def xxx.def This gave me a set of working import libraries. Next was to port the headers across. In order to get the COM stuff working, I used objbase.h and objidl.h from Jacob Navia's LCC-Win32 (please tell me if this violates any copyright). In doing so, I ran into some problems with structures missing from the GNU-Win32 header files. You will need to make the following additions to your windows headers before you can use this port: #define NONAMELESSUNION // Because nameless unions are plentiful in DirectX // and there is also one in objidl.h #ifndef _stdcall #define _stdcall STDCALL // Because objidl uses _stdcall #endif typedef HANDLE HTASK; // Because it's missing... #define GUID_DEFINED // If it's not there... // This is missing #define MAKE_HRESULT(s,f,c) ((HRESULT)(((DWORD)(s)<<31)|((DWORD)(f)<<16)|((DWORD)(c)))) // This lot are just plain missing... typedef GUID IID; typedef IID *LPIID; typedef IID *REFIID; typedef CLSID *REFCLSID; typedef GUID *REFGUID; typedef struct _RPC_VERSION { WORD MajorVersion; WORD MinorVersion; } RPC_VERSION; typedef struct _RPC_SYNTAX_IDENTIFIER { GUID SyntaxGUID; RPC_VERSION SyntaxVersion; } RPC_SYNTAX_IDENTIFIER, * PRPC_SYNTAX_IDENTIFIER; typedef struct _RPC_MESSAGE { HANDLE Handle; unsigned long DataRepresentation; void * Buffer; unsigned int BufferLength; unsigned int ProcNum; PRPC_SYNTAX_IDENTIFIER TransferSyntax; void * RpcInterfaceInformation; void * ReservedForRuntime; void * ManagerEpv; void * ImportContext; unsigned long RpcFlags; } RPC_MESSAGE, * PRPC_MESSAGE; I added #ifdefs to ifdef out the anonymous unions and replace them with named unions if the header is being compiled under GCC (the majority do not include windows.h, so checking for the NONAMELESSUNION define from there is futile.) **README**: You need to add a blank WTYPES.H. Lastly, I ported MMSYSTEM.H as DSOUND.H needs lots of stuff from it... This resulted in a working port of all the DirectX components I have bothered to port... :-) I haven't tested all the components extensively, but I believe they work... :-) Peter Hawkins (dph-man@iname.com)