Compiling on Microsoft Visual C++ Toolkit 2003

It would descript the method of building a SDL program using Microsoft Visual C++ Toolkit 2003.

Requirement

Create msvcprt.lib

msvcprt.lib is required, but not supplied offically. You may need to build it yourself.

Create exports.sed :

/[ \t]*ordinal hint/,/^[ \t]*Summary/{
  /^[ \t]\+[0123456789]\+/{
    s/^[ \t]\+[0123456789]\+[ \t]\+[0123456789ABCDEFabcdef]\+[ \t]\+[0123456789ABCDEFabcdef]\+[ \t]\+\(.*\)/\1/p
  }
}

Then execute it to the msvcp71.dll ( can be found at .NET SDK )

echo LIBRARY msvcp71.dll > msvcprt.def
echo EXPORTS >> msvcprt.def
link -dump -exports msvcp71.dll | sed -nf exports.sed >> msvcprt.def
link -lib -machine:X86 -def:msvcprt.def -out:msvcprt.lib

Notice that the link.exe you run here should be from Microsoft, not cygwin or others.

Environment variables

Compiling

cl /TP /MD /EHsc main.cpp /link SDL.lib SDLmain.lib /SUBSYSTEM:WINDOWS

FAQ_Compiling_on_Microsoft_Visual_C++_Toolkit_2003 (last edited 2008-04-17 08:18:52 by localhost)