Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Matsen

limits and windows.h a no no?

This topic is 5400 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

limits doesn't seem to like windows.h, or vice versa. For some strange reason, this does not compile:
#include <windows.h>
#include <limits>

int main()
{
	std::numeric_limits<char>::max();
}
 
The compiler (.NET 2003 standard) says: : warning C4003: not enough actual parameters for macro 'max' : error C2589: '(' : illegal token on right side of '::' : error C2143: syntax error : missing ';' before '::' If I don't include windows.h, it compiles just fine. What's wrong?! Edit: < > [edited by - Matsen on October 8, 2003 4:11:35 AM]

Share this post


Link to post
Share on other sites
Advertisement

#define NOMINMAX
#include <windows.h>
#include <limits>

int main()
{
std::numeric_limits::max();
}


Edit: Thanks neoztar

[edited by - Matsen on October 8, 2003 4:20:36 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!