关于MPLAB C18编译提示“Error - section '.udata_main.o' can not fit the section. Section '.udata_main.o' len

关于MPLAB C18编译提示“Error - section '.udata_main.o' can not fit the section. Section '.udata_main.o' length=0x00000606”这类错误的解决方法  

 

这两天用MPLAB IDE v8.84 + MPLAB C18 + PIC18F2620编译程序,程序中有一个比较大的数组,长度超过了256字节,因此就出现了上面的错误提示,网上收索了关于这个问题的解答,说得最多的解答方式如下:

关于MPLAB C18编译提示“Error - section .udata_main.o can not fit the section. Section .udata_main.o length=0x00000606”这类错误的解决方法 - 北极星 - xiebingsuccess的博客

我最初也是按照这种方式去修改,修改后问题依旧,感觉不起作用,后来找到了一篇英文版的解释(http://www.xargs.com/pic/c18large.html),可能是作者在翻译的时候有些遗漏,其中第2点“ Add a linker script to your project. With recent versions of the compiler, linker scripts are located in the compiler's bin/LKR directory. Be sure to get your linker script from bin/LKR rather than the lkr directory, since the scripts in the latter directory are obsolete, and should not be used. The lkr directory also does not include scripts for newer PICs.”,就是说要从MPLAB C18的安装目录下的bin/LKR目录下拷贝一个对应单片机的链接脚本到MPLAB IDE的工程目录下,然后进行对应的修改,这样C18在链接的时候就会使用修改后的在工程目录下的单片机链接脚本,最开始我是直接在bin/LKR这个目录下面对相应的单片机链接脚本进行修改,但一直没有效果,就是没有拷贝到工程中这个原因。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值