可能涉及的人员、
每当我使用中定义的标准整数类型的#define limits 时、我都会遇到"Symbol could not be resolved"错误 。 例如、我 在代码中使用 uint32_MAX 来获取包含 uint32_t 类型的最大值 但是、我收到错误"Symbol could not be resolved"。 作为一种权变措施、我必须使用一个抑制 //@suppress ("符号未解析")来成功编译。 输入时的值 我看到以下定义了 UINT32_MAX 和其他标准类型的最大值的代码:
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
/* 7.18.2 Limits of specified width integer types */
#if defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \
defined(__TMS320C55X_PLUS_BYTE__) || defined(__ARP32__) || \
defined(__PRU__) || defined(__C7000__)
#define INT8_MAX 0x7f
#define INT8_MIN (-INT8_MAX-1)
#define UINT8_MAX 0xff
#endif
#define INT16_MAX 0x7fff
#define INT16_MIN (-INT16_MAX-1)
#define UINT16_MAX 0xffff
#define INT32_MAX 0x7fffffff
#define INT32_MIN (-INT32_MAX-1)
#define UINT32_MAX 0xffffffff
#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__C7000__) || \
defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__)
#define INT64_MAX 0x7fffffffffffffff
#define INT64_MIN (-INT64_MAX-1)
#define UINT64_MAX 0xffffffffffffffff
#elif defined(__TMS320C2000__)
#if defined(__TMS320C28X__) || \
(defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
#define INT64_MAX 0x7fffffffffffffff
#define INT64_MIN (-INT64_MAX-1)
#define UINT64_MAX 0xffffffffffffffff
#endif
#endif
// etc. etc.
#endif
中的整个代码段 在我的 Code Composer Studio 窗口中、似乎呈灰色显示、表示_cplusplus 是在某个位置定义的...除了我找不到它的定义位置? _cplusplus 未在我在项目中拥有的任何文件中定义、也未在我所知的任何项目属性中定义(例如 CCS Build > C2000 Compiler > Predefined Symbols)。 我目前正在编写 C 代码、因此我 不会在任何地方使用__cplusplus。 我还对我的项目文件进行了全局搜索、找不到__cplusplus 可以定义的其他位置。 这部分代码为什么位于中 变灰了吗? 这是编译器/ Code Composer Studio 错误吗? 我假设这就是我在尝试在代码中使用 uint32_MAX 时遇到编译器错误"无法解析符号"的原因。
非常感谢您的帮助、谢谢!








