Skip to content

Instantly share code, notes, and snippets.

@BeErikk
Created November 25, 2021 11:40
Show Gist options
  • Save BeErikk/41fe25afcc53a1917fee0e118376d926 to your computer and use it in GitHub Desktop.
Save BeErikk/41fe25afcc53a1917fee0e118376d926 to your computer and use it in GitHub Desktop.
Visual Studio 2008 modified paths
<?xml version="1.0" encoding="utf-8"?>
<VCPlatformConfigurationFile Version="8.00">
<Platform Name="VCProjectAMD64Platform.dll" Identifier="{656d8763-2429-11d7-8bf6-00b0d03daa06}">
<Directories
Include="$(CurrentVS)VC/Tools/MSVC/$(CurrentVCTools)/include;$(CurrentVS)VC/Tools/MSVC/$(CurrentVCTools)/atlmfc/include;$(CurrentVS)VC/Auxiliary/VS/include;$(CurrentVS)VC/Auxiliary/VS/UnitTest/include;$(CurrentKits)10/Include/$(CurrentUCRT)/ucrt;$(CurrentKits)10/Include/$(CurrentUCRT)/winrt;$(CurrentKits)10/Include/$(CurrentUCRT)/cppwinrt;$(CurrentKits)10/Include/$(CurrentUCRT)/um;$(CurrentKits)10/Include/$(CurrentUCRT)/shared;$(CurrentKits)10/Include/$(CurrentUCRT)/km;$(CodeLibraries)include;$(CodeLibraries)include/wtl;$(WindowsSource)include;"
Library="$(CurrentVS)VC/Tools/MSVC/$(CurrentVCTools)/lib/x64;$(CurrentVS)VC/Tools/MSVC/$(CurrentVCTools)/atlmfc/lib/x64;$(CurrentVS)VC/Auxiliary/VS/UnitTest/lib;$(CurrentKits)10/Lib/$(CurrentUCRT)/ucrt/x64;$(CurrentKits)10/Lib/$(CurrentUCRT)/um/x64;$(CurrentKits)10/Lib/$(CurrentUCRT)/km/x64;$(CodeLibraries)lib/x64;$(CurrentVS)VC/Tools/Llvm/x64/lib;"
Path="$(CurrentVS)VC/Tools/Llvm/x64/bin;$(CurrentVS)VC/Tools/MSVC/$(CurrentVCTools)/bin/HostX64/x64;$(CurrentKits)10/bin/$(CurrentUCRT)/x64;$(CurrentVS)Common7/IDE;$(CurrentVS)Common7/tools;$(CurrentVS)Common7/IDE/CommonExtensions/Microsoft/TestWindow;D:/devapps/compilers/LLVM/bin;D:/devapps/bin;C:/Windows/Microsoft.NET/Framework64/v4.0.30319;$(PATH)"
Reference="C:/Windows/Microsoft.NET/Framework64/v4.0.30319"
Source="$(CurrentVS)VC/Tools/MSVC/$(CurrentVCTools)/crt/src;$(CurrentKits)10/Source/$(CurrentUCRT)/ucrt;$(CurrentVS)VC/Tools/MSVC/$(CurrentVCTools)/atlmfc/src/mfc;$(CurrentVS)VC/Tools/MSVC/$(CurrentVCTools)/atlmfc/src/atl;"/>
</Platform>
</VCPlatformConfigurationFile>
@BeErikk
Copy link
Author

BeErikk commented Nov 25, 2021

Example config file to allow custom compiler paths i Visual Studio 2008, more specific allow using later Visual Studio tools, for example, Visual Studio 2022. One problem is that the paths change at each Visual Studio update. A solution is to have environmental variables which are easy to update manually at each update.

Create a symbolic link to this file in <VS2008>\VC\vcpackages\ with the name AMD64.VCPlatform.config, replacing the old file.

Environment variables:
CurrentVS - Installation path of recent Visual Studio (eg Visual Studio 2022)
CurrentVCTools - MS compiler tools version
CurrentKits - Microsoft SDK path
CurrentUCRT - Microsoft SDK version

Compare the CMD-script in
mscompiler script

@Mewgood
Copy link

Mewgood commented Nov 25, 2021

Thanks alot! Very appreciated.

I'm not at my pc right now, so I can't check what differences there are in the x86 config. Would you mind sharing this too?

@BeErikk
Copy link
Author

BeErikk commented Nov 25, 2021

@BeErikk
Copy link
Author

BeErikk commented Nov 25, 2021

Another tip that I always do is to have a .vsprops file for each project with the following settings

<Tool
Name="VCCLCompilerTool"
AdditionalOptions="-Wall -MP -sdl -guard:cf -Zo -std:c++latest -permissive- -Zc:__cplusplus -Zc:preprocessor -Zc:externConstexpr -Zc:inline -Zc:throwingNew"
/>
This will bring modern C++ settings to the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment