Subset-SDL - cross-compiling build problem

Hi there,

I am using a smaller SDL .DLL using xmingw32 using a subset of the SDL
function that is to be used just for audio playback. This is the
configure line to do that:

CONFIGURE_FLAGS="–disable-debug --disable-video --disable-events
–disable-joystick --disable-cdrom --disable-arts --disable-nas"
cross-configure $CONFIGURE_FLAGS

I end up with a compact 32k DLL/.so. A Linux test program works well
with this lib using a standard main() routine.

My Windows test program has a line like this:

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR
szCmdLine, int iCmdShow)
{

}

When cross-compiling, I get this error:

usr/local/cross-tools/i386-mingw32msvc/lib/libSDLmain.a(SDL_main.o.bSDL_main.o.b):
In function console_main': /home/andreas/Projects/Libraries/SDL-1.2/src/main/SDL_main.c:166: undefined reference toSDL_RegisterApp’

Any ideas on how to resolve this …?

Ciao
Andreas

Sorry … made a mistake in my previous error description. Here it is
again:

If I have a main() routine in the program I get the described error when
cross-compiling.

If I put a WinMain() routine into the test program, the error
dissapears.

As far as I can tell, main() gets substituted to SDL_main() by the
compiler flag. SDL_main() calles SDL_RegisterApp() which is undefined
because of the configure flags to get the smaller SDL.dll.

Bye
Andreas

Sorry … made a mistake in my previous error description. Here it is
again:

If I have a main() routine in the program I get the described error when
cross-compiling.

If I put a WinMain() routine into the test program, the error
dissapears.

As far as I can tell, main() gets substituted to SDL_main() by the
compiler flag. SDL_main() calles SDL_RegisterApp() which is undefined
because of the configure flags to get the smaller SDL.dll.

Right. The problem is that SDL uses DirectSound on Windows, and
DirectSound is tied to a window handle (gotta love DirectX). It
may work for you, but if sound doesn’t work, you’ll have to poke
around in the source to see where the window handle is set in the
sound code, so it works with your window handle.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software