lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


This isn't really about Lua, but it comes up often here, so I thought I'd share my idiosyncratic solution, which allows me to use the latest Microsoft compiler and Windows SDK while still linking against msvcrt.dll.

I do this with Visual Studio 2008 Professional, the Windows SDK version 6.0A (bundled with VS2008), and the Windows Driver Kit version 6.0. My .cmd file for setting the appropriate environment variables is attached. The msvcrt.lib import library in the Windows Driver Kit references msvcrt.dll. The major caveat is that you have to include "msvcrt_win2000.obj" on the command line, or the resulting binary will only run on Windows Vista and later. I was unable to devise a way around this. Still, this is the best solution I've found.

Hope this helps,
Matt
@echo off
set PATH=C:\Program Files\Microsoft VIsual Studio 9.0\VC\bin;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;%PATH%
set include=C:\winddk\6000\inc\crt;C:\winddk\6000\inc\api\crt\stl70;C:\Program Files\Microsoft Visual Studio 9.0\VC\include;C:\winddk\6000\inc\atl30;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include
set lib=C:\winddk\6000\lib\crt\i386;C:\winddk\6000\lib\atl\i386;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib;C:\winddk\6000\lib\w2k\i386;C:\Program Files\Microsoft Visual Studio 9.0\VC\lib