This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/TM4C123GH6PM:错误#242: 声明中的说明符重复

Guru**** 2024750 points
Other Parts Discussed in Thread: TM4C123GH6PM
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/670883/ccs-tm4c123gh6pm-error-242-duplicate-specifier-in-declaration

器件型号:TM4C123GH6PM

工具/软件:Code Composer Studio

您好!

我正在尝试为 TM4C123GH6PM launchpad 编译一个项目。 我从 TI 提供的一个示例项目开始、并将自己的模块逐个添加到其中。

遗憾的是、我现在陷入编译器抱怨的问题、如下所示:

```μ A

>>编译失败
subdir_rules.mk:9:目标'main.obj'的配方失败
"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h "、第42行:错误#242:
声明中的说明符重复
typedef signed char int8_t;
^μ A

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h "、第42行:错误#85:
类型说明符的组合无效
typedef signed char int8_t;
^μ A

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h "、第43行:错误#242:
声明中的说明符重复
typedef unsigned char uint8_t;
^μ A

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h "、第43行:错误#85:
类型说明符的组合无效
typedef unsigned char uint8_t;
^μ A

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h "、第44行:错误#242:
声明中的说明符重复
typedef short int16_t;
^μ A

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h "、第44行:警告#377-D:
声明需要 typedef 名称
typedef short int16_t;
^μ A

```μ A

我可以理解、编译器告诉我已经为 INT8_t 完成了 typedef、但知道在哪里的方法是什么

第一种类型定义已完成(我无法从编译器错误消息中找出)?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Sudep、
    欢迎来到论坛。
    查看"main.c"中包含文件的列表。 您可以将"stdint.h"移动到列表顶部。 现在、另一个 include 文件(或 main.c 本身)将显示为有问题的 typedef 复制器。