Problem with include files

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem with include files

1,182件の閲覧回数
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,064件の閲覧回数
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 件の賞賛
返信