Up-to-date instructions on Linux based cross-compiler to Win32

Daniel Green venix1 at gmail.com
Fri Mar 30 13:12:15 PDT 2012


On 3/29/2012 1:34 PM, Marco Leise wrote:
> As the topic suggests, I'm looking for instructions to get a cross-compiler working on Linux and the ones in the Wiki are fairly outdated, referring to old versions of D2 and GCC.
>
> The compiler actually builds, but it cannot build Phobos, with these lines of errors:
> /home/marco/Entwicklung/D/gdc/dev/gcc-4.6.2/windows/./gcc/gdc -B/home/marco/Entwicklung/D/gdc/dev/gcc-4.6.2/windows/./gcc/ -L/home/marco/Entwicklung/D/gdc/dev/gcc-4.6.2/windows/i686-mingw32/winsup/mingw -L/home/marco/Entwicklung/D/gdc/dev/gcc-4.6.2/windows/i686-mingw32/winsup/w32api/lib -isystem /home/marco/Entwicklung/D/gdc/dev/gcc-4.6.2/winsup/mingw/include -isystem /home/marco/Entwicklung/D/gdc/dev/gcc-4.6.2/winsup/w32api/include -B/usr/i686-mingw32/bin/ -B/usr/i686-mingw32/lib/ -isystem /usr/i686-mingw32/include -isystem /usr/i686-mingw32/sys-include -Wall -g -frelease -O2  -nostdinc -pipe -fdeprecated -I ../../../libphobos -I ./i686-mingw32  -fintfc-file=import/core/sys/windows/dbghelp.di -fsyntax-only ../../../libphobos/core/sys/windows/dbghelp.d
> ../../../libphobos/core/sys/posix/sys/un.d:17: Error: import __anonymous sa_family_t not found
> ../../../libphobos/core/sys/posix/sys/un.d:17: Error: alias core.sys.posix.sys.un.sa_family_t recursive alias dec

I don't think Johannes patch will fix that.  That's a result of GDC's 
desire to make all the headers.  Which ends up failing for Windows. 
Even DMD doesn't try to make that one.

To fix, just wrap the import statement in version( posix ).  It's what I 
have the MinGW builds do.



More information about the D.gnu mailing list