Problem with include files

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problem with include files

1,180 次查看
juliancox
Contributor V

I have a CW11 project for a MC9S08QE processor using ProcessorExpert.

The significant components are SPI master (SM1) and a Free counter (FC1).

The projet comprises four files, main.c, main.h, events.c and events.h. The only include statements are 

#include "main.h" in main.c and 

#include "events.h" in events.c

When I declare a variable in one .h file and declare it as external in the other I get the error:

ERROR L1818: Symbol 24 - HexTemp duplicated in SM1_c.obj and Events_c.obj.

I get the same error message for up to 10 variables and sometimes the first reference is CPU.c.obj.

 I tried re-naming the variable to no avail and I also tried deleting the offending .obj files.

I get the same problem when I cut from main .h file and paste it into events.h.

My only solution is to cut the offending variable from events.h and paste it into events.c and then I get no errors.

I re-created a new project with the same components and I got the same problem.

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

1,062 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello  Julian Cox,

Could you please send your project or a simple project that can reproduce the issue,

I will check it  on my side.

BR

Alice

0 项奖励
回复