dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Can't view C headerfiles of Visual Studios?

  1. #1
    Join Date
    Nov 2018
    Posts
    19

    Can't view C headerfiles of Visual Studios?

    Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include

    Is the include directory on my computer for VS2017, and I can view many headerfiles in this directory. However C headerfiles are missing.

    cstring has inside it #include<string.h> but where is it including string.h from!

    Is it IMPOSSIBLE to view C headerfile implementations of VS2017?

    Can the implementation of C headerfiles vary across compilers?

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,611

    Re: Can't view C headerfiles of Visual Studios?

    The easiest way to see the contents of a VS header file is to #include it in a source file (eg #include <string.h> ), then right click on the file name and choose open document. This will then open the specified header file. Once it is open, if you move the cursor over its name in the tabs then it shows the location of the file.

    The implementation of header files certainly varies across compilers. The compiler vendor produces its own header files as part of its c/c++ language implementation.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2017 (15.9.9)

  3. #3
    Join Date
    Nov 2018
    Posts
    19

    Re: Can't view C headerfiles of Visual Studios?

    Cool I didn't know you could do that! Thanks!

    I thought I could see how the headerfiles implements functions like strcmp but heck I didn't understand a word!

  4. #4
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,611

    Re: Can't view C headerfiles of Visual Studios?

    MS heavily use macros in their header files! Also, the source of many of the 'c' functions are not actually in the header files (all they contain are the function forward declarations) - they are in separate source files as strcmp() etc are classed as 'Common run time' (CRT) and they come as a set of .dlls. That's why there are options to download/install 'c run-time' files as they are version specific. So for example, if you generate a x64 .exe that uses the crt functions from complier ver xy, then the crt .dll files for x64 ver xy need to be present on all computers that use that program. If they are not, you get a run-time error.

    To see the source for these functions, look in c:\Program Files (x86)\Windows Kits\10\Source\10.0.17763.0\ucrt (or the highest numbered version folder shown). The sub folders from ucrt relate to the various c includes. So strcmp() source is in the string sub-folder as strcmp.c

    Have fun!
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2017 (15.9.9)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)