1

I use windows 10 as test server and try to build from source code of python & C++. I installed vcbuild 2015 by choco choco windows package manager

When I try to build the source, I find error.

E:\downloads\Twisted-17.1.0>cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -IC:\Python36\include -IC:\Python36\include /Tcsrc/twisted/test/raiser.c /Fobuild\temp.win-amd64-3.6\Release\src/twisted/test/raiser.obj
raiser.c

c:\python36\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory

I can not find the io.h in my vc++ include path: But according to the passage: Universal CRT

I find the io.h file is in my C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt

Then I find my Universal CRT is empty

C:\WINDOWS\system32>set UniversalCRT_IncludePath
Environment variable UniversalCRT_IncludePath not defined

Then I define that envirnoment variable:

E:\downloads\Twisted-17.1.0> set UniversalCRT_IncludePath="C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"

Then I try to compile the source code again, but I still get an error:

E:\downloads\Twisted-17.1.0>cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -IC:\Python36\include -IC:\Python36\include /Tcsrc/twisted/test/raiser.c /Fobuild\temp.win-amd64-3.6\Release\src/twisted/test/raiser.obj
raiser.c

c:\python36\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory

Anyone know how to make the UniversalCRT_IncludePath works in command line environment, how cl.exe try to use that variable and make it including default c++ including path.

user504909
  • 9,119
  • 12
  • 60
  • 109
  • @HarryJohnston That is not duplicated, my question is about UniveersalCRT_IncludePath – user504909 Feb 13 '17 at 02:24
  • My mistake, sorry. – Harry Johnston Feb 13 '17 at 04:51
  • 1
    If you use the Developer Command Prompt shortcut, the directory in question is listed in the `INCLUDE` environment variable. If you're setting up your environment by hand, you can presumably do the same thing, or list the directory as a command-line argument as Ben suggests. – Harry Johnston Feb 13 '17 at 04:55

1 Answers1

1

There's nothing special about UniversalCRT_IncludePath to cl.exe.

An MSBuild variable by that name (not the same as an environment variable or a shell variable) is used by the New-Project Wizard templates for Universal CRT to calculate the command-line to pass to cl.exe.

Because you're invoking the compiler by hand, you should just add a /I switch with that directory and not bother with any environment variable that the compiler doesn't look for anyway.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720