Compiling SDL-0.11.2 *native* on Win32

I’ve attempted to compile SDL-0.11.2 on Win32 using Cygnus cygwin beta 20.
Here’s my environment:

cygwin-b20 with gcc-2.95
mingw32 with gcc-2.95 installed as i386-mingw32-gcc, etc.
Linux-like file structure with /usr, /usr/local, etc.

I tried to configure SDL by using the following invocation:
CC=i386-mingw32-gcc configure --target=i386-mingw32 --disable-directx -v

I’ve also used variations of the above with --host=i386-mingw32, etc.
The configure process works without any problems. These are the issues
I’m having:

  1. Minor bug in win32/SDL_main.c. SDL_main.c includes only SDL_main.h,
    which doesn’t have the prototype for SDL_Quit(). I just included SDL.h
    and that fixed it.
  2. The audio/ Makefile still tries to compile SDL_dx5audio.c, even though
    –disable-directx was specified. To fix this I edited the audio/Makefile
    and changed SDL_dx5audio.* to SDL_dibaudio.*.

SDL compiles and installs without any further problems. When trying to
compile the test programs, however, I receive undefined references to
"_alloca()" from SDL_sysvideo.o. I was under the assumption that
_alloca() is part of the CRTDLL runtimes for mingw32, which is what I
should’ve compiled with.

To all you cygwin/mingw people out there: Have you been able to compile
SDL natively under these environments? Any other gotchas I should be
aware of? I won’t even begin to describe the horrors of trying to compile
dx5 and dib SDL-0.10.0 with mingw32, the autoconf’d 0.11.2 is a big
improvement :slight_smile:

Marcus

“M. R. Brown” wrote:

I’ve attempted to compile SDL-0.11.2 on Win32 using Cygnus cygwin beta 20.
Here’s my environment:

cygwin-b20 with gcc-2.95
mingw32 with gcc-2.95 installed as i386-mingw32-gcc, etc.
Linux-like file structure with /usr, /usr/local, etc.

I tried to configure SDL by using the following invocation:
CC=i386-mingw32-gcc configure --target=i386-mingw32 --disable-directx -v

I’ve also used variations of the above with --host=i386-mingw32, etc.
The configure process works without any problems. These are the issues
I’m having:

  1. Minor bug in win32/SDL_main.c. SDL_main.c includes only SDL_main.h,
    which doesn’t have the prototype for SDL_Quit(). I just included SDL.h
    and that fixed it.
  2. The audio/ Makefile still tries to compile SDL_dx5audio.c, even though
    –disable-directx was specified. To fix this I edited the audio/Makefile
    and changed SDL_dx5audio.* to SDL_dibaudio.*.

SDL compiles and installs without any further problems. When trying to
compile the test programs, however, I receive undefined references to
"_alloca()" from SDL_sysvideo.o. I was under the assumption that
_alloca() is part of the CRTDLL runtimes for mingw32, which is what I
should’ve compiled with.

To all you cygwin/mingw people out there: Have you been able to compile
SDL natively under these environments? Any other gotchas I should be
aware of? I won’t even begin to describe the horrors of trying to compile
dx5 and dib SDL-0.10.0 with mingw32, the autoconf’d 0.11.2 is a big
improvement :slight_smile:

Marcus

Okay, the latest CVS version has much better Win32 support (and I built
a new cross-compiler based on gcc-2.95.2)

The hitch is that the new CVS is on a Loki server, and DNS hasn’t been
updated for you to see it by name. In the meantime, you can access it
at:
:pserver:guest at 209.223.115.153:/cvs
When you do your cvs login, the password is “guest”

I will make an official announcement later, when our DNS is fully
configured on the new T1.–
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Thanks Sam, FYI the module name is SDL.

Marcus>

Okay, the latest CVS version has much better Win32 support (and I built
a new cross-compiler based on gcc-2.95.2)

The hitch is that the new CVS is on a Loki server, and DNS hasn’t been
updated for you to see it by name. In the meantime, you can access it
at:
:pserver:guest at 209.223.115.153:/cvs
When you do your cvs login, the password is “guest”

I will make an official announcement later, when our DNS is fully
configured on the new T1.

-Sam Lantinga, Lead Programmer, Loki Entertainment Software