Skip to content

Instantly share code, notes, and snippets.

@DanCraft99
Created August 13, 2017 08:02
Show Gist options
  • Save DanCraft99/3a99be44e26a1cd878b8578863cfcef6 to your computer and use it in GitHub Desktop.
Save DanCraft99/3a99be44e26a1cd878b8578863cfcef6 to your computer and use it in GitHub Desktop.
Setup for building Windows Application from command lines using VS 2017 C++ Build Tools
@echo Setting Includes paths now....
@echo `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat x64 10.0.15063.0`
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
set WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10
@echo Overriding Setting Includes paths now....
SET INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um;%INCLUDE%
SET INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt;%INCLUDE%
SET INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared;%INCLUDE%
SET INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\winrt;%INCLUDE%
echo Setting Library paths now....
SET LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64;%LIB%
SET LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\x64;%LIB%
@DanCraft99
Copy link
Author

DanCraft99 commented Aug 13, 2017

VS 2017 C++ Build Tools allows you to build Windows Applications from command lines. The setup may seem pretty easy to do download and install the tools and SDKs from http://landinghub.visualstudio.com/visual-cpp-build-tools. It may again seem straightforward to build your very first "Hello World" app from command line.

Yet even with a clean OS, the setup could have missed out the include paths for the newly installed Windows SDK paths. You have to fix it by yourself by searching through online forums. That could take hours.

Wish the above saves you from a few minutes of hair-pulling moments.

@DanCraft99
Copy link
Author

Please take note that this gist is FOR and ONLY FOR those few coders that prefer build applications from command lines. For others, please stick to your Visual Studio Professional or Community build for bullet-proof build setups.

@DanCraft99
Copy link
Author

The whole trouble of the setup comes from the aging SDK tool vcvarsall.bat used for the Build environment setup. That tool is not well maintained and lack of documentation. Somehow, you will need to pray and find your way out when things do not work out as claimed.

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