Compiling on Microsoft Visual C++ Toolkit 2003
It would descript the method of building a SDL program using Microsoft Visual C++ Toolkit 2003.
Requirement
- SDL Development Libraries for VC++ ( 1.2.9 )
- Microsoft Visual C++ Toolkit 2003
- Microsoft Platform SDK ( Windows Server 2003 SP1 )
- Microsoft .NET Framework SDK ( v1.1 )
- sed from unxutils or cygwin
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
- PATH : includes VC++ compiler and .dll folders . ( C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;C:\SDL-1.2.9\bin )
- LIB : includes .lib folders. ( C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;C:\Program Files\Microsoft Platform SDK\Lib;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib;C:\SDL-1.2.9\lib;C:\path to msvcprt.lib\ )
- INCLUDE : includes .h folders . ( C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;C:\Program Files\Microsoft Platform SDK\Include;C:\SDL-1.2.9\include )
Compiling
cl /TP /MD /EHsc main.cpp /link SDL.lib SDLmain.lib /SUBSYSTEM:WINDOWS
