@ symbol wont compile in 10.2

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

@ symbol wont compile in 10.2

跳至解决方案
989 次查看
SecondTechCo
Contributor IV


I am working on Codewarrior version 10.2.

 

I am using the example of AN3748 and am trying to compile.  It wont import directly so I had to bring in the files manually.  I cant get this line to compile

 

const byte NVPROT_INIT @0x0000040D  = 0xFB;

 

It keeps givng me an error "bad character sequence encountered"

Can someone tell me why ?

 

 

 

标签 (1)
0 项奖励
回复
1 解答
680 次查看
SecondTechCo
Contributor IV

Thanks.  I tried your suggestions without any luck.  So I reexamined the code and found my statement was within a function block.  I moved it outside of the function block and it worked fine.  Thank you for the help.  Your trying it and letting me know it worked fine really helped.

在原帖中查看解决方案

0 项奖励
回复
7 回复数
680 次查看
michaelsanderse
Contributor I

Hi William.

Can you please help us. We are trying AN3748 in CW10, but are getting errors. See

https://community.nxp.com/message/317644

0 项奖励
回复
680 次查看
SecondTechCo
Contributor IV

try usr_entry_c.obj (.text)

For my file, I called it bootloader.c and here was the syntax for the lcf file

bootloader_c.obj (.text)

0 项奖励
回复
680 次查看
michaelsanderse
Contributor I

Thanks, of course that was it.

0 项奖励
回复
680 次查看
BlackNight
NXP Employee
NXP Employee

Which CPU/architecture are you using?

Depending on your compiler, the @ probably is not supported (it is not part of ANSI C).

Or you have an option set to compile in strict ANSI mode (something like -Ansi).

The message indicates that the line might have a bad ASCII character, but I think this is rather unlikely.

Hope this helps.

680 次查看
SecondTechCo
Contributor IV

MCF51.

This is sample code from freescale that I am compiling straight from the the referenced article so I would assume the at sign is good but that is my basic question.   The example was done using the preeclipse compilers though.

0 项奖励
回复
680 次查看
BlackNight
NXP Employee
NXP Employee

I tried this with my MCF51CN128 and CodeWarrior:

const int b@0x123;

and this works fine.

That kind of syntax is supported AFAIK in the pre-eclipse compiler too.

So I still think that this is because of your option settings: could you check that you do *not* have things set like

ANSI Strict: -strict on

ANSI keywords only: -stdkeywords on

in the compiler language settings?


Apart of that: have you 'byte' declared? Maybe try to change your line of code to

const unsigned char NVPROT_INIT @0x0000040D  = 0xFB;


Hope this helps.

681 次查看
SecondTechCo
Contributor IV

Thanks.  I tried your suggestions without any luck.  So I reexamined the code and found my statement was within a function block.  I moved it outside of the function block and it worked fine.  Thank you for the help.  Your trying it and letting me know it worked fine really helped.

0 项奖励
回复