none
C4458 RRS feed

  • Question

  • VS 2015 Community under Windows 7 Pro

    I ported VS 2013 MFC project to VS 2015 Community.

    I build the project and was able to run it, but I got a lot of C4458 warnings, all for headers in Windows Kit, like

    >c:\program files (x86)\windows kits\8.1\include\um\gdiplusheaders.h(695): warning C4458: declaration of 'nativeCap' hides class member

    Of course I can hide these warnings, but what is wrong?

    • Moved by Tina-Shi Monday, August 3, 2015 9:49 AM related to C++
    Saturday, August 1, 2015 2:29 AM

All replies

  • Hi Geoyar,

    Since this issue is related to the C++, so we will move this case to the C++ forum, you will get better respond.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 3, 2015 9:48 AM
  • It does not matter at what Forum I get the right answer, but my question is not about C++. C++ and VC++ code in my app are OK and are compiled without complaints by VS2013 and VS 2012 and VS 201o VC++ compilers. It is something in VS 2015 Community VC++ compiler that do not object to building the app but generates C4458 warnings related to hidden class members in Windows Kit 8.1.

    It is VS 2015 question.

     
    Monday, August 3, 2015 7:21 PM
  • I have the same problem ...
    Wednesday, August 5, 2015 5:05 AM
  • Hi Geoyar,

    Do you build the MFC project on windows 10?

    Do you have any simple project could reproduce this issue? I have created a simple MFC project using GDI+ in VS2013 and upgrade it in VS 2015, cannot repro this issue.

    Shu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 5, 2015 6:38 AM
  • 1. The project was built in VS2010 Pro. Upon the time it was ported from S2010 Pro  to VS2012 Ultimate, after that ported from VS2012 Ultimate to VS2013 Ultimate, and finally ported to VS 2015 Community. In each port I had some warnings related to code in the project. I was able to easy fix these mini-problems.

    2. I do not installed Windows 10, so all work was done under Windows 7 Pro.

    3. The simple project - I also going to test it. and I expect to have no problems too. I think test like you did and I am going to do were already done by MS C++ team. I think the warning are related to some specific modules in Windows Kit 8.1. By a way, somebody reported these warning to VS Connect Visual Studio and .Net bugs.

    Wednesday, August 5, 2015 7:42 PM
  • As I mentioned, I did two MFC projects: single document and dialog-based. I compiled and run the code supplied by MFC project templates, no code by myself. Result is: no warnings
    Wednesday, August 5, 2015 8:10 PM
  • If you make a new project to compile, it won't show these warnings as the default Warning level is Level4(/W4)

    If you change it to Level3, you should see them.

    Wednesday, August 5, 2015 10:29 PM
  • It seems like it is a typo: the default warning level in VC++ native C++ projects is level 3 (W3). The level 4 is the top level that generates all warnings.

    I used level 4 (W4) in the ported project and in the test MFC projects I have mentioned.

    C4458 is generated in the ported project and is not present in the test MFC projects.

    Wednesday, August 5, 2015 11:48 PM
  •  

    @Geoyar

    did you find a solution to this problem ?

    Thursday, November 21, 2019 5:28 AM
  • Really:

    #pragma warning(push)
    #pragma warning(disable :4458)
    #include <gdiplus.h>
    #pragma warning(pop)

    Or:

    Are the only real options beyond using the Windows 10 Feedback Hub to suggest that the Windows SDK team fix this warning.

    The newer versions of the compiler does have the concept of external headers:

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview>cl /nologo /? | find "/external"
    /external:I <path>      – location of external headers
    /external:env:<var>     – environment variable with locations of external headers
    /external:anglebrackets – treat all headers included via <> as external
    /external:W<n>          – warning level for external headers
    /external:templates[-]  – evaluate warning level across template instantiation chain

    However this is still experimental. An external header is a header that is external to your project, such as a library header.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Thursday, November 21, 2019 11:23 AM