奇怪的C ++与code有MIN()/最大错误()调用 [英] Strange C++ errors with code that has min()/max() calls

查看:117
本文介绍了奇怪的C ++与code有MIN()/最大错误()调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到奇怪的错误,当我的C ++ code的MIN()或MAX()调用。我使用Visual C ++编译器。

I'm seeing strange errors when my C++ code has min() or max() calls. I'm using Visual C++ compilers.

推荐答案

检查您的code被包括在 WINDOWS.H 头文件,要么你的code或其他三阶方头都有自己的 MIN() / MAX()的定义。如果是,那么prePEND您的 WINDOWS.H 与包容的定义的 NOMINMAX 是这样的:

Check if your code is including the windows.h header file and either your code or other third-party headers have their own min()/max() definitions. If yes, then prepend your windows.h inclusion with a definition of NOMINMAX like this:

#define NOMINMAX
#include <windows.h>

这篇关于奇怪的C ++与code有MIN()/最大错误()调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆