Build can't find imagehlp.h

I’m taking a different tack on trying to figure out the wxGridWindow crash (see thread on Users).
Windows 10 Pro 64
Python 3.8.2 64
Visual Studio 15
Windows Kits 8.1

> git status
HEAD detached at wxPython-4.1.0

I run

> python build.py 3.8 dox etg --nodoc sip

Everything is fine, then the build_wx phase fails to find the aforementioned header file:

> python build.py build
Will build using: "C:\Program Files\Python38\python.exe"
3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
Python's architecture is 64bit
cfg.VERSION: 4.1.0

Running command: build
Running command: build_wx
MSVC: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe
wxWidgets build options: ['--wxpython', '--unicode']
creating wx/msw/setup.h from setup0.h
setting build options...
nmake.exe -f makefile.vc UNICODE=1 OFFICIAL_BUILD=1 COMPILER_VERSION=140 SHARED=1 MONOLITHIC=0 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

	cl /c /nologo /TP /Fovc140_mswudll_x64\basedll_appbase.obj /MD /DWIN32  /I..\..\src\zlib /I..\..\src\regex /I..\..\src\expat\expat\lib  /Zi  /Fd..\..\lib\vc140_x64_dll\wxbase314u_vc140_x64.pdb   /O2 /D_CRT_SECURE_NO_DEPRECATE=1  /D_CRT_NON_CONFORMING_SWPRINTFS=1 /D_SCL_SECURE_NO_WARNINGS=1  /D__NO_VC_CRTDBG__  /D__WXMSW__    /DNDEBUG      /D_UNICODE /I..\..\lib\vc140_x64_dll\mswu /I..\..\include   /W4 /DWXBUILDING /DwxUSE_GUI=0  /DWXMAKINGDLL_BASE /DwxUSE_BASE=1 /GR /EHsc  /Yu"wx/wxprec.h" /Fp"vc140_mswudll_x64\wxprec_basedll.pch"   ..\..\src\common\appbase.cpp
appbase.cpp
C:\Users\efahlgren\Abductor\Phoenix\ext\wxWidgets\include\wx/msw/debughlp.h(29): fatal error C1083: Cannot open include file: 'imagehlp.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.
Error building
ERROR: failed building wxWidgets
Traceback (most recent call last):
  File "build.py", line 1471, in cmd_build_wx
    wxbuild.main(wxDir(), build_options)
  File "C:\Users\efahlgren\Abductor\Phoenix\buildtools\build_wxwidgets.py", line 503, in main
    exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
  File "C:\Users\efahlgren\Abductor\Phoenix\buildtools\build_wxwidgets.py", line 85, in exitIfError
    raise builder.BuildError(msg)
buildtools.builder.BuildError: Error building
Finished command: build_wx (0m2.644s)
Finished command: build (0m2.644s)

A quick find shows that imagehlp.h is in the 8.1 location that I’d expect it to be found (I’ve got VS 2017 installed on this machine, too, hence the SDK 10 stuff):

c:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/um/ImageHlp.h
c:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/um/ImageHlp.h
c:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/um/ImageHlp.h
c:/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/um/ImageHlp.h
c:/Program Files (x86)/Windows Kits/8.1/Include/um/ImageHlp.h

Am I missing a configuration option somewhere to get that include path in the above cl command line? I’ve done “clean_all” a couple times, started new cmd shells and it does exactly the same thing from scratch.

Did you run from a “Developer Command Prompt” or whatever it’s called? When you run that it sets up the environment in the command shell window for include paths, and etc. so the compiler and SDKs can be found.

Aha, no, I only tried in a cygwin shell, then when that failed I tried plain cmd. I’ll try that, thanks!

I also use cygwin, but it’s been so long that I don’t remember if I had to do anything to get it to find the SDKs.

Well, the “Developer Command Prompt for VS2015” compiled a bit farther, then failed with the same issue. So I tried my cygwin “Visual Studio” .bat file, which works fine. It sets up VS 2017, but then the wxPython build script finds VS 2015 and carries on from there.

chdir "c:\Program Files (x86)\Microsoft Visual Studio\2017\"
if exist Professional (
    cd "Professional\VC\Auxiliary\Build\"
) else (
    chdir "Community\VC\Auxiliary\Build\"
)
vcvarsall.bat amd64 & (chdir %USERPROFILE% & (start C:\cygwin64\bin\mintty.exe -i o:/mintty/visual.ico -))

The result:

------------ BUILD FINISHED ------------
To use wxPython from the build folder (without installing):
 - Set your PYTHONPATH variable to C:\blah\Phoenix.

Finished command: build_py (6m15.602s)
Finished command: build (10m42.239s)
Done!

Thanks again!