<terp.cpp> and Microsoft Visual C++

Introduction

terp can work with more than one installed version of Visual C++. It normally finds installed versions by inspecting the registry. When terp finds a registry key indicating that there is a copy of Visual Studio installed, it looks for a C++ compiler in a well known subdirectory of the installation, attempts to run it to determine its version number and remembers it. terp is able to find both the native compiler and cross compilers for other processor architectures.

When you use the ^msvc() executor without any arguments, terp picks the native Visual C++ compiler with the largest version number. To select one of the cross compilers, you will have to use a processor architecture specifier, as in ^msvc({procarch:amd64}). When you want to choose an older compiler instance, you need to specify a version, such as ^msvc({version:14}).

Version numbers

To have the same behavior accross platforms, we chose to use the compiler versions rather than the Visual Studio versions when selecting compilers. This means that you cannot ask for the C++ compiler with version 2005 to get the Visual Studio 2005 C++ compiler. But how do the compiler version numbers relate to Visual Studio version numbers? The following table contains the relationship between Visual Studio version number and C++ compiler version number.

Relationship between Studio and C++ versions
Visual Studio Visual C++ Version
Visual Studio 6 '12.00'
Visual Studio .NET '13.00'
Visual Studio 2003 '13.10' (that is '13.10', not '13.1')
Visual Studio 2005 '14.00'
Visual Studio 2008 '15.00'

Execution environment

Most versions of Microsoft Visual C++ can only be successfully invoked if the execution environment has been set up properly, usually by running a batch file (vcvars32.bat) that is supplied as part of the Visual Studio installation. terp locates this file automatically and when you execute the compiler instance, terp turns this into a batch file invocation that includes the setup script invocation and the compiler invocation. You can override the setup script by specifying a different value for the executor's vcvars property.


Copyright 2006-2016 by Codemesh, Inc., ALL RIGHTS RESERVED

:
using Microsoft Visual C++
codemesh.com home expressions templates ant about us contact us download   

Commandline