C++ – Building Boost – can’t find windows.h

boostc

I'm trying to build boost on windows 7 64-bits. Running bootstrap gives

execnt.c(29) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

and some others. I have visual studio 9.0 and the places where I have windows.h is in

  • C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Include**W**indows.h, with capital W
  • C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include**W**indows.h
  • C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\Smartphone2003\Include\windows.h

I have the SDK installed and even fully reinstalled Visual studio. Any way I can fix this?

  • Small update: I installed Visual C++ 2010 express and from the IDE I can include and the test project compiles just fine, but when I use the prompt NO projects can find the header

Best Answer

Try running the boost build from a VS console rather than trying to run 'cmd'. It's probably somewhere in the start menu entry for VS (used to be anyway). It used to also be available from VS itself under tools, but I think they removed it there.

This version is just cmd, but it runs a batch script that sets a bunch of very important environment variables.