IAR MSP430编译报错说明 联系客服

发布时间 : 星期五 文章IAR MSP430编译报错说明更新完毕开始阅读0d51f54048d7c1c708a1455e

从debug切换到release出现错误:release不会自动继承debug的设置,需要

自己重新设置:

snprintf、fmax、fmin这些函数都能在IAR帮助中找到,但是却出现下面错误:

Error[e46]: Undefined external \Settings\\Administrator\\桌面\\塔吊安全监控系统-终版\\塔吊安全监控系统-终版\\ Release\\Obj\\cacu_protect.r43 )

Error[e46]: Undefined external \Settings\\Administrator\\桌面\\塔吊安全监控系统-终版\\塔吊安全监控系统-终版\\ Release\\Obj\\cacu_protect.r43 )

Error[e46]: Undefined external \Settings\\Administrator\\桌面\\塔吊安全监控系统-终版\\塔吊安全监控系统-终版\\ Release\\Obj\\gprs_8.r43 ) Error while running Linker 错误原因:链接库的设置不对:

Error[Pe077]:

this declaration has no storage class or type specifier

不同的版本,就有不同的写法,就像环境不一样,中断函数的名字也不一样,我遇到过这样的情况(两个不同版本下定时器初始化时寄存器的名称不同). 如I/O口中断函数的名的两种版本:

版本1:interrupt[PORT2_VECTOR] void PORT2 (void)

版本2:#pragma vector=PORT1_VECTOR __interrupt void PORT1_ISR (void) 2012.2.x UESTC

8Q:

Error[Pe136]:

struct \Instruments\\ZStack-1.4.3-1.2.1\\Projects\\zstack\\Samples\\SampleApp\\Source\\SampleApp.c 417

//--------------------------------------------// afAddrType_t dstAddr;

dstAddr.addrMode = afAddrBroadcast;

dstAddr.addr.shortAddr = 0xFFFF; // 广播发送 cdwxl

dstAddr.endpoint = SAMPLEAPP_ENDPOINT; //error所在 //--------------------------------------------// A:

我们看看afAddrType_t这个结构就明白错在哪里了。 typedef struct { union {

uint16 shortAddr; } addr;

afAddrMode_taddrMode; byteendPoint; } afAddrType_t;

居然是 endPoint 大小写错误,Ω 。 9Q:

我最开始也是IAR仿真时找不到main函数, 显示:

Fri Jun 11 14:37:00 2010: Error (col 1): Unknown or ambiguous symbol. main Fri Jun 11 14:37:01 2010: Error (col 1): Unknown or ambiguous symbol. main Fri Jun 11 14:37:01 2010: Couldn't go to 'main'.

之后在project==>options==>linker里面的format设成debug,没有这个问题了,但是 程序又不能通过TI的那个Flash Programmer下载到板子里了,说是Could not open specified HEX file A:

这个烧录工具只认release code. 而且扩展名必须是.hex。 所以要用这个烧录工具来烧录必须做两件事: 1. output file设为release version

2. output file 扩展名改为.hex, 默认的是.a51

测试学习阶段可以不用.但产品量产就必须生成二进制文件. 同时programmer还有些其它的功能会常用的

Error[Pe142]: expression must have pointer-to-object type

表达式两边的类型不一样。2012.2.x uestc 例如:

“编译的错误是指第一个?*?的后面应该是指针,却给了是非指针表达式。

如果p是个指针,那么*(p+i)是p后面第i个域或单元的元素,这个域与p所指的变量类型有关,

也就是说'*(p+i)+j'是数,而非指针。与*结合就错了。 ” http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=931945

C++的该错误:

http://efreedom.com/Question/1-4943607/Expression-Must-Pointer-Object-Type-Subscript-Requires-Array-Pointer-Type Error[Pe148]:

variable \

\=0; \声明可外部调用需要赋值

Error[Pe159]: declaration is incompatible with previous

没加头文件,或者主函数内有子函数,而子函数定义在主函数后边而木有在主函数前声明一下。

Error[Pe169]: expected a declaration 错误原因可能性: 1、void read_gprs_return(); { …… }

定义函数的时候,结尾多了一个分号:;。

Error[Pe852]:

Error[Pe852]:expression must be a pointer to a complete object type

Error[Pe260]:

explicit type is missing (\桌面\\下位机\\塔吊防碰撞系统1.1版(SIM908 倾角查询)\\5438A塔吊防碰撞1.1\\LCD(SmallFonts).c 898

问题例子1:定义一个函数,落了红字部分声明

void DrawSector(int x,int y,int R1,int R2,float Ds ,float De,int fill,uchar color) {

…… }

11Q:Error[Pe513]:

a value of type \\

Instruments\\ZStack-1.4.3-1.2.1\\Components\\stack\\sapi\\sapi.c 968

A:估计是一个函数本没有返回值即void类型,而你却将这个函数赋给了一个int型变量了。。 static rxCB( uint8 port,uint8 event )改为 static void rxCB( uint8 port,uint8 event ) 12Q:

Fatal Error[e72]: Segment BANK_RELAYS must be defined in a segment definition option (-Z, -b or -P) A: