After messing around with the headers, I'm
somewhat able to use g++ (has to be g++,
unless you don't include xtl.h). The VC linker
is still required to create the XBE though. Would
be great if someone can figure it out.
Here's what I did:
1. convert filenames of include files to lower case.
Edit include/xbox.h to use lowercase for
<pshpack1.h> and <poppack.h>
This is optional, but I'm using a mingw cross
compiler from Linux, so case sensitivity is a
problem
2. Replace #endif __cplusplus and
D3DCOMPILE_NOTINLINE in include/d3d8.h
D3DCONST with static const (causes linker
errors)
4. #define __int64 as long long. g++ does not
support __int64.
5. Remove inline asm in include/winnt.h (or
replace with gcc inline asm). I don't use those
functions, so removing didn't cause any
problems.
6. Compile using the followign compiler options:
D_STDCALL_SUPPORTED -D_M_IX86 -
D_WCHAR_T_DEFINED -D__forceinline=inline
-nostdinc -nostdlib -fno-builtin -fno-exceptions
-I <xdk include path>
7. Create main "stub" and compile using VC
compiler. This is a workaround as g++
'mangles' the 'main' symbol symbol so that
it becomes ___main causing linker errors at
the end.
extern "C" void XMain();
int main() { XMain(); }
note: The entry point in the your program now has to be XMain.
Pretty kludgy, but it works for me.