ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
在利用Keil C51编程时,发现程序逻辑上没有错误,但在连接时却出现了错误,如下:
*** ERROR L107: ADDRESS SPACE OVERFLOW
SPACE: DATA
SEGMENT: ?DT?GMNS_3V4
LENGTH: 0014H
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: RECEIVE_TIMER
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: DUAL_REC_BUF
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: LAST_SEND_TIME_COUNT
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: POW_STATUS
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: POW_STATE
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: GROUP_TEST
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: S_COUNT_P
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: R_COUNT_P
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: RING_JUDGE_STATEB1
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: RING_JUDGE_STATEB0
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: YAOXIN_CHECK_STATUS4
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: YAOXIN_CHECK_STATUS3
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: YAOXIN_CHECK_STATUS2
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: YAOXIN_CHECK_STATUS1
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: YAOXIN_CHECK_STATUS0
SEGMENT: ?DT?GMNS_3V4
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: YAO_XIN_COUNT
SEGMENT: ?DT?GMNS_3V4
出现以上错误的原因主要是第一个原因,第一个原因导致了它下面所有错误,第一个原因是:
ERROR L107: ADDRESS SPACE OVERFLOW
SPACE: DATA
SEGMENT: ?DT?GMNS_3V4
LENGTH: 0014H
说明data空间已经不够用,原因是你可能有好多函数,而函数内部的局部变量又没有定义其空间,这种情况下,系统会将变量分配到你在Otions for Target 对话框里的设置的空间。如果你在 Memory Model 里设置成 Small:variables in DATA,则DATA空间很快便用完,导致data空间不够用。解决的办法有两种,一是通过更改Memory Model设置,可以设置成pdata或xdata,以便有足够大的空间,但这又带来新的问题,程序运行速度减慢,而且code代码也会加大,因为如果一个局部变量被存放在了xdata空间,汇编语言访问xdata空间的代码大小要比访问data空间的代码大,变量一旦很多,程序的代码也会逐渐增大;二是根据自己的要求设置变量的空间。所以这涉及到代码优化的问题,遇到具体问题时,在运行速度和代码大小之间取得适合自己的情况。
文章评论(0条评论)
登录后参与讨论