Skip to content

Instantly share code, notes, and snippets.

@tbrosman
Last active August 19, 2016 06:42
Show Gist options
  • Save tbrosman/169e70c9aff4587cf818a9020a390f55 to your computer and use it in GitHub Desktop.
Save tbrosman/169e70c9aff4587cf818a9020a390f55 to your computer and use it in GitHub Desktop.
Troubleshooting MSVC path issues (hxcpp)

Started with: fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory

Found http://community.openfl.org/t/openfl-to-windows-fatal-error-cannot-open-typeinfo-h/7930/3 but the solution didn't work.

Searched around more, saw that the msvc toolchain bat file is what sets up the paths (D:\HaxeToolkit_3_2_0\haxe\lib\hxcpp\3,2,205\toolchain\msvc-setup.bat). It gets called every time compilation happens and it calls the vc vars setup script (on my machine: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools....\VC\bin\x86_amd64\vcvarsx86_amd64.bat'). Some notes on how the MSVC toolchain works for Visual Studio 2015 (which I am using in this case): http://community.openfl.org/t/visual-studio-2015/5839

Running vcvarsx86_amd64.bat directly produced the error ERROR: Cannot determine the location of the VS Common Tools folder. Digging around/reading the bat script revealed this value comes from the registry. Related: https://schrievkrom.wordpress.com/2011/01/25/error-cannot-determine-the-location-of-the-vs-common-tools-folder/

I manually created HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7. Under that key: ("14.0", "REG_SZ", "C:\Program Files (x86)\Microsoft Visual Studio 14.0\"). I also made sure reg.exe was in my path (I had nuked my path earlier, so "C:\Windows\System32" was no longer part of it).

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