[SDL] CVS stable again, please update SDL ports

William Petiot [exoide] william at exoide.com
Fri Feb 24 16:49:35 PST 2006


I realize that you really wanted to undef HAVE_LIBC to build SDL.dll under 
visual C++

#define HAVE_LIBC 1
in SDL_config_win32.h
is certainly not a solution !

The problem shows up when linking SDLmain.lib in a user program. Not when 
building SDL.dll.

If you "#define HAVE_LIBC 1" in SDL_win32_main.c before including the unmodified 
SDL_config_win32.h, this modifies only SDLmain.lib.

the tests build without any error. This "solution" is certainly better as it 
permit to build an app without link to msvcrt if one wants to use his own 
SDLmain.lib which doesn't need MSVCRT (and if his own app doesn't need it).

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/main/win32/SDL_win32_main.c,v
retrieving revision 1.8
diff -r1.8 SDL_win32_main.c
9a10
 > #define HAVE_LIBC	1



William Petiot [exoide] a écrit :
> As a test, I tried a VisualC.zip -> unzip -> build, tests\tests.dsw -> build.
> 
> When linking with SDLmain and SDL, any test program, the symbol __fltused is 
> multiple-defined.
> 
> Not sure if it's a right solution (which impact on other build?), but, for a 
> standard win32 build, when defining HAVE_LIBC in SDL_config_win32.h, it works.
> 
> This remove the declaration "int declspec(selectany) _fltused=1; " done in
> SDL_windows.h (I guess this is here for a build without any libc available).
> 
> VisualC++ decides to include a reference to this variable when doing any 
> float/double operation (to link floating point support from libc). I had to add 
> msvcrtd.lib(debug config) and msvcrt.lib (release)  to the list of linked 
> library in SDL.dsp, to permit the reference to _ftol and such (used by VisualC++ 
> when casting a float to an int, implicitly, etc).
> 
> 
> 
> RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/include/SDL_config_win32.h,v
> retrieving revision 1.3
> diff -r1.3 SDL_config_win32.h
> 46a47,48
>  > #define HAVE_LIBC		1
>  >
> 
> 
>> SDL can now be built without any C runtime support, depending on the
>> drivers and OS support available.  There is a new directory src/stdlib,
>> and SDL_getenv.c has been moved there, and several other files have been
>> added to the source tree.





More information about the SDL mailing list