1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

_WIN32_WINNT undefined

Discussion in 'C' started by ever_thus, Jan 3, 2007.

  1. ever_thus

    ever_thus New Member

    Joined:
    Jan 3, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    0
    I'm starting out with Visual Studio 2005. I have an application that worked fine with the Borland bcc32 compiler, but when I compile with VS I get several errors telling me that this or that constant is undefined.

    Checking the header files I found that these constants are conditionally defined depending on the value of _WIN32_WINNT. A simple test program compiles under bcc32 and VS tells me that _WIN32_WINNT is defined as 0x501 under bcc32 and undefined under VS.

    I'm running Windows XP, so I assume _WIN32_WINNT should be defined to the right value. How do I make sure this is so. I could explicitly define it in my code, but this ought not be necessary.

    Any help would be appreciated.
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Have a look here. Perhaps bcc presumes too much.
     
  3. ever_thus

    ever_thus New Member

    Joined:
    Jan 3, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    0
    Thanks. Adding the option works. Is there any way I can tell VS to do this for all projects unless I specify otherwise.
     
  4. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Have you consulted the help files? Read your documentation? I would suggest that developing personal initiative and resourcefulness is as valuable as learning a new language. Strictly personal opinion, of course.
     
  5. ever_thus

    ever_thus New Member

    Joined:
    Jan 3, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    0
    Actuallly I did. And googled it. Everyone tells me to set the CL environment variable, whic I did. However I still don't see this option defined when I check the properies windows. Am I setting it in the wrong place.
     

Share This Page