WINVER not defined.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RiaanDP
    New Member
    • Nov 2006
    • 3

    #1

    WINVER not defined.

    Hi there,

    I'm new to VS2005, I only worked on VS .NET and VS6 before.

    I'm receiving a compiler warning on each file when I compile my program:

    WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)

    my stdafx.h file contains the following line:

    #ifndef WINVER
    #define WINVER 0x0501
    #endif

    when add "WINVER=0x0 501" in the preprocessor definitions in the property pages it does the trick, but can anyone explain to me why it doesn't work in stdafx.h? It can create a potential problem for me, as I need to define some other directives at a later stage in stdafx.h.

    I'm including a lot of .h/.cpp files originally written in VS6 via a single header file that I include in my stdafx.h. It's on compiling these VS6 classes that I receive the warnings.

    Any help would be greatly appreciated,

    Riaan
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You should have stated what file and line number you go the warning on.

    Anyway the most liekly cause of the problem is that you have put the definition of WINVER below the #included files, it will be one of those files producing the error so the definition of WINVER needs to come first.

    Comment

    Working...