_WIN32_WINNT undefined

Contributor
3Jan2007,20:10   #1
ever_thus's Avatar
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.
Team Leader
3Jan2007,21:28   #2
DaWei's Avatar
Have a look here. Perhaps bcc presumes too much.
Contributor
3Jan2007,21:43   #3
ever_thus's Avatar
Thanks. Adding the option works. Is there any way I can tell VS to do this for all projects unless I specify otherwise.
Team Leader
3Jan2007,22:16   #4
DaWei's Avatar
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.
Contributor
3Jan2007,23:34   #5
ever_thus's Avatar
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.