Version 2 of Building Tcl with the free VC++ toolkit

Updated 2004-05-13 00:56:01

PT 13-May-2004

Microsoft recently made the optimising version of their C and C++ compiler available for free download [L1 ]. This is fairly useful for building open source projects which often provide a Visual C++ build environment. Tcl is one such OS project.

There are a few issues using the toolkit to build anything useful. There are a few utilities that have not been provided and at least one link library. However, all is not lost. You can get all the bits from alternative free sources.

Firstly, you should install the most recent Platform SDK [L2 ] - this provides all the current libraries and headers for building anything on windows.

Missing utilities: cvtres.exe, lib.exe and nmake.exe. It turns out that you can use the versions provided with the Platform SDK Win64 tools. I suggest copying these utilities from %MSSDK%\bin\win64\ to your VC++ toolkit binaries directory.

Missing msvcrt.lib - this is the link library for the C runtime used by Tcl and most extensions. You can in theory create a link library from a .dll using link -dump -exports dllname and some processing, but I have been unable to make this work. Instead you can install the .NET Framework SDK (free download) and get a copy of msvcrt.lib from this [L3 ]

Finally, the compiler no longer accepts the -GD option and the linker will not accept -link50compat so you should remove these.

Setup your INCLUDE, LIB and PATH environment variables to point first to the Platform SDK and then the toolkit directories: eg: my vcsetup7.bat file...

  @echo off
  set MSDEVDIR=%VCToolkitInstallDir%
  set INCLUDE=%MSSDK%\include;%VCToolkitInstallDir%\include
  set LIB=%MSSDK%\lib;%VCToolkitInstallDir%\lib
  set PATH=%MSSDK%\bin;%VCToolkitInstallDir%\bin;%PATH%

Now you can build tcl using the <tcl>/win/makefile.vc NMAKE makefile. Or you could use Msys and CC=cl configure