INT32_MAX/SIZE_MAX WAS NOT DECLARED IN THIS SCOPE 解决办法

现象可以概括为stdint.h中的宏定义没有生效,即宏定义没有在编译的预处理(preprocessor)阶段被替换(原因不明)。

解决办法是将宏定义改为compile time constance,例如

#include <limits>
const int32_t INT32_MAX = std::numeric_limits<int32_t>::max();

参考:

http://stackoverflow.com/questions/3233054/error-int32-max-was-not-declared-in-this-scope

posted @ 2015-11-08 18:20  lych2e  阅读(1500)  评论(0编辑  收藏  举报