Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   _WIN32_WINNT undefined (http://www.go4expert.com/forums/win32winnt-undefined-t2429/)

ever_thus 3Jan2007 20:10

_WIN32_WINNT undefined
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.

DaWei 3Jan2007 21:28

Re: _WIN32_WINNT undefined
Have a look here. Perhaps bcc presumes too much.

ever_thus 3Jan2007 21:43

Re: _WIN32_WINNT undefined
Thanks. Adding the option works. Is there any way I can tell VS to do this for all projects unless I specify otherwise.

DaWei 3Jan2007 22:16

Re: _WIN32_WINNT undefined
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.

ever_thus 3Jan2007 23:34

Re: _WIN32_WINNT undefined
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.

All times are GMT +5.5. The time now is 05:42.