MS linker warning

Hello all,

I’m using SDL and I’m trying to make things work with the microsoft
compiler.

All compiles and links well under linux (using gcc), but on my
winXP PC (using the MS compiler/linker) I get this:

MSVCRTD.lib(secchk.obj) : warning LNK4210: .CRT section exists; there may be
unhandled static initializers or terminators

Things seem to work ok when I run my app, but I’d still like to resolve this
because it sounds a bit scary that all statics in secchk could get
mangled…

In case it helps, here are my compiler and linker flags:

C++FLAGS
/O2
/nologo
/I"D:/Lab/Cosmos/Code/Lib"
/I"D:/Lab/Cosmos/Code/Game"
/D"_MBCS"
/D"DEBUG"
/D"WIN32"
/FD
/EHsc
/MDd
/GS
/Fd"vc70.pdb"
/W3
/WX
/Wp64
/Zi
/TP

LINKFLAGS
/INCREMENTAL:NO
/NOLOGO
/DEBUG
/PDB:“Kosmos.pdb”
/SUBSYSTEM:CONSOLE
/OPT:REF
/OPT:ICF
/MACHINE:X86
/ENTRY:SDL_main
SDL.lib
SDLmain.lib
OpenGL32.lib
Glu32.lib
Kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib

Any ideas?
cheers,
Kos.

if you already have it setup for linux compiling, you might be interested in
getting mingw/msys

mingw is gcc/g++ for windows and msys is a bash prompt for windows with a
linux type file structure (/bin/ /include/ etc).

i use em and they are great.

you can grab em here http://www.mingw.org/

sorry dunno what your problems with the MS compiler are from though :P> ----- Original Message -----

From: kos@climaxgroup.com (Kostas Kostiadis)
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Friday, December 17, 2004 10:59 AM
Subject: [SDL] MS linker warning…

Hello all,

I’m using SDL and I’m trying to make things work with the microsoft
compiler.

All compiles and links well under linux (using gcc), but on my
winXP PC (using the MS compiler/linker) I get this:

MSVCRTD.lib(secchk.obj) : warning LNK4210: .CRT section exists; there may
be
unhandled static initializers or terminators

Things seem to work ok when I run my app, but I’d still like to resolve
this
because it sounds a bit scary that all statics in secchk could get
mangled…

In case it helps, here are my compiler and linker flags:

C++FLAGS
/O2
/nologo
/I"D:/Lab/Cosmos/Code/Lib"
/I"D:/Lab/Cosmos/Code/Game"
/D"_MBCS"
/D"DEBUG"
/D"WIN32"
/FD
/EHsc
/MDd
/GS
/Fd"vc70.pdb"
/W3
/WX
/Wp64
/Zi
/TP

LINKFLAGS
/INCREMENTAL:NO
/NOLOGO
/DEBUG
/PDB:“Kosmos.pdb”
/SUBSYSTEM:CONSOLE
/OPT:REF
/OPT:ICF
/MACHINE:X86
/ENTRY:SDL_main
SDL.lib
SDLmain.lib
OpenGL32.lib
Glu32.lib
Kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib

Any ideas?
cheers,
Kos.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Make sure you’re linking with the MSVCRT DLL runtime, like it says in the FAQ.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I am…That’s what the /MD (or /MDd) option does.
If you look at my original warning:

MSVCRTD.lib(secchk.obj) : warning LNK4210: .CRT section exists; there may be
unhandled static initializers or terminators

you’ll see that the warning comes from MSVCRTD.lib…
I have no idea how to get rid of it…
If anyone knows, pls do tell…

The problem is that for this to work, CRT init code needs
to run…But because I have to pass /ENTRY:SDL_main, the
app doesn’t call the CRT init stuff (I think crtMainStartup is
what win expects…)

cheers,
Kos.> ----- Original Message -----

From: sdl-bounces+kos=climaxgroup.com@libsdl.org
[mailto:sdl-bounces+kos=climaxgroup.com at libsdl.org]On Behalf Of Sam
Lantinga
Sent: 19 December 2004 21:47
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] MS linker warning…

Make sure you’re linking with the MSVCRT DLL runtime, like it says in the
FAQ.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl