How to fix macro redefined errors

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

How to fix macro redefined errors

2,912 次查看
robotjosh
Contributor IV

There is a macro PSP_MAXIMUM_INTERRUPT_VECTORS defined in cortex.h.  When I compile there are 6 identical errors generated, the macro is redefined 6 times.  In cortex.h it starts with #ifndef __cortex_h__ followed by #define __cortex_h__ so it should be impossible for this error to happen.  Even if this header is included 6 times, that #ifndef should cause the entire file to be skipped if it was already included.  How do I make this compile right?  This error is the same for codewarrior 10.5 and 10.3.

 

I saw this thread CodeWarrior 10 Macro Redefined Compile Error and created a prefix file containing "#pragma once on" but the compile errors come out exactly the same.

 

There are 2 other errors "the file 'fnet_cpu.h' cannot be opened" and "the file 'fnet.h' cannot be opened" which are puzzling because those files exist with read permissions right next to other files that the compiler was able to open.

 

I also tried to clean and refresh the project with no effects.

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

2,247 次查看
Rick_Li
NXP Employee
NXP Employee

hi Jordan,

as you mentioned in your reply in SR, the he macro error was because the motor control .a file wasn't being included correctly.

if you need further assistance, then, please contact us again!

0 项奖励
回复