[Connect Update 5 C++] Trouble getting compiler to recognize windows files

Upgraded to the latest SDK for Update 5

I have installed VS 2015 since that is now required..now I am having a hell of a time getting the bentley compiler to recognize files like windows.h and winsock.h

fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

do I need to include the windows SDK paths in my make file?

Any help would be greatly appreciated!

  • Hi Maury,

    I presume this is based on where the shell/tools believe VS2015 is located. From a developer shell, type: "set vs".
    Are the path values correct, incorrect, or empty? Alternately, from the developer shell you could try to confirm if the VS environment script is being resolved and called correctly by typing: "where vcvars32.bat"; which we call and should configure VS tools environment properly.

    Lastly, if these compilation errors are coming from the developer shell, what color is the text within the developer shell (white or yellow)? White is administrative user (and as will all tools called), Yellow is standard user (not likely to have all necessary permissions required).

    Bob



  • Hi Bob,

    Thanks for the response.

    The paths all look good..   I tried both with and without admin priv.  In either case it cannot locate the header files.

    By manually adding the windows sdk directories in to the MKE file, the compiler is locating the headers fine,  but now i am running into similar issues with locating lib files.

    C:\PROGRA~1\Bentley\MICROS~2\examples>set vs
    VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
    VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
    VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
    VS90COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\
    VSDIR=C:\PROGRA~2\MICROS~4.0\
    VSDIRS=VSDIR VCBIN VCINC VCLIB
    VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\
    
    C:\PROGRA~1\Bentley\MICROS~2\examples>where vcvars32.bat
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat


  • Two of the samples delivered also include windows.h:

    C:\PROGRA~1\Bentley\MICROS~2\examples\Constraints\constraint2ddemo\constraint2ddemo.cpp:18:#include <windows.h>
    C:\PROGRA~1\Bentley\MICROS~2\examples\Miscellaneous\steel\steel.cpp:13:#include <windows.h>

    Do either of these have issue compiling?

    You can try to capture and review full/verbose logging details from the build process using: bmake +avilC AppName > %temp%\buildoutput.txt. If that does not help identify an errant path, you may want to zip and post the buildoutput and a complete "set" of your environment to review. Similarly, if the sample above Do compile, then consider zipping a bare bones version of your project so we can review, comment, and help further.

    Thank you,
    Bob



  • My windows.h is being resolved from:

         C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\Windows.h

    Though surprising to me, newer versions of Microsoft Visual Studio actually require you to check/install additional components to provide a fully functional C++ build environment.  The most important non-default I know of to this point is needing to check the "Visual C++" option for a developer install.  Puzzling. :)

    I likely have checked additional items too since I work across a variety of different project types.  I will check to see if I can determine what Visual Studio 2015(+) installer options may need to be checked to ensure windows headers, libraries, etc. are also present.  I do know these/my items are installed as part of: Windows SDK Desktop Tools "Windows SDK Desktop Headers Libs Metadata" components.

    UPDATE:  This Microsoft post may be a/our starting point to understand the new install requirements for Visual C++ developer environments

    Setup Changes in Visual Studio 2015 Affecting C++ Developers. 

    I will need to look further into this so I can determine if we should proactively publish a new "Additional Recommendations" clause to our exiting Microsoft Visual Studio Requirements help topic.

    Bob



  • Yea, the 2015 install was a pain..I have already gone through all those headaches to make sure c++ was installed with all of the custom options enabled. It doesn't help that any change takes 45 minutes...I spent all of yesterday uninstalling\reinstalling\modifying installation of 2015 until it finally recognized c++ and let me compile a console application properly..

    Then I moved to MicroStation and ran into these issues. :(
  • Unknown said:
    newer versions of Microsoft Visual Studio actually require you to check/install additional components to provide a fully functional C++ build environment.  The most important non-default I know of to this point is needing to check the "Visual C++" option for a developer install

    I'm sure you're not the only one puzzled by Viz Studio installation.  As well as that option, have I interpreted correctly that one also needs the Windows XP option to obtain the platform SDK?

    Unknown said:
    I will need to look further into this so I can determine if we should proactively publish a new "Additional Recommendations" clause to our exiting Microsoft Visual Studio Requirements help topic

    We'll be grateful for that!

     
    Regards, Jon Summers
    LA Solutions

  • Uninstalled and Reinstalled again, still getting this problem.
    Any chance having installed Visual studio 2017 is causing the problem?

    No idea what to do next, forcing directories in the mke and mki files didnt work.
  • Maury,

    Your VS2017 install is fine and should have no impact on your VS2015 install.

    I am still backtracking the VS2015 product installer components, specifically "Windows SDK for Windows Store Apps Headers" that is responsible for installing that exact file in the location needed (on my computer). Though not 100% confident with this recommendation (though highly likely) you could try to run your VS2015 installer and Check and Add the feature: "Universal Windows App Development Tools" > "Windows 10 SDK (10.0.HighestVersionListed)". Then try to compile and see if the necessary windows headers and libraries are installed/discovered. I will update with more precision later tonight or tomorrow.

    HTH,
    Bob



  • Bob,

    Thanks for taking the time! It is much appreciated.

    I already have the entire Universal windows app development section checked in my install. The problem is not with my files missing, I have the exact file in the same folder as you do. If I make a normal console application through visual studio, it will find it and compile fine.

    BMake finds the cl.exe in the visual studio VC directory and starts compiling so the environment is at least partially working, it is just having issues locating the headers and libs.