|
小弟目前有一隻程式使用 typwdef
- //Type_Define.h 如下
- typedef unsigned char uint08_t;
- typedef unsigned int uint16_t;
- typedef unsigned long uint32_t;
复制代码
同時有兩個.h檔 include它
- //TIM_CTRL.h如下
- #include "Type_Define.h"
- void TIM2_CHx_Modex(uint08_t,uint08_t);
复制代码
- //Wayne_STM8_Init.h如下
- #include "Type_Define.h"
- void Wayne_OPT_init(void);
- void Wayne_GPIO_init(void);
- uint16_t Wayne_TIM1_init(uint08_t UD_Hz);
- void Wayne_TIM2_init(void);
复制代码
後續再將這兩個TIM_CTRL.h和Wayne_STM8_Init.h整合
- //main.h如下
- #include "iostm8s001.h"
- #include "TIM_Bits.h"
- #include "TIM_CTRL.h"
- #include "TIMER_DATA_TABLE.h"
- #include "OPT.h"
- #include "Wayne_STM8_Init.h"
- void Wayne_delay(uint32_t times);
- void Wayne_delay_ms(uint32_t times);
复制代码
結果出現
#error cpstm8 Type_Define.h:2(22+8) redeclared typedef uint08_t
#error cpstm8 Type_Define.h:3(22+8) redeclared typedef uint16_t
#error cpstm8 Type_Define.h:4(22+8) redeclared typedef uint32_t
請問各位,這種問題怎麼解呢? |
阿莫论坛20周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|