fcluy 发表于 2024-12-19 22:14

PIC 单片机 C 程序 MAPLAB 编译出错是什么原因?

<p>Error &nbsp; ; . can&#39;t find 0xC words for psect &quot;temp&quot; in segment &quot;COMBANK&quot;<br />
Error &nbsp; ; . can&#39;t find 0xBB words (0xbb withtotal) for psect &quot;text14&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0xBA words (0xba withtotal) for psect &quot;text21&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0xAA words (0xaa withtotal) for psect &quot;text24&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x8D words (0x8d withtotal) for psect &quot;text22&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x72 words (0x72 withtotal) for psect &quot;text9&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x72 words (0x72 withtotal) for psect &quot;text20&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x65 words (0x65 withtotal) for psect &quot;text17&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x4E words (0x4e withtotal) for psect &quot;text12&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x3F words (0x3f withtotal) for psect &quot;text13&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x1E words (0x1e withtotal) for psect &quot;text0&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x1C words (0x1c withtotal) for psect &quot;text7&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x1C words (0x1c withtotal) for psect &quot;text6&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x16 words (0x16 withtotal) for psect &quot;text8&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x16 words (0x16 withtotal) for psect &quot;text15&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x15 words (0x15 withtotal) for psect &quot;text&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x15 words (0x15 withtotal) for psect &quot;text1&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x13 words (0x13 withtotal) for psect &quot;text11&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x13 words (0x13 withtotal) for psect &quot;text16&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x11 words (0x11 withtotal) for psect &quot;text4&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x11 words (0x11 withtotal) for psect &quot;text3&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x11 words (0x11 withtotal) for psect &quot;text5&quot; in segment &quot;CODE&quot;<br />
Error &nbsp;&nbsp;</p>

fcluy 发表于 2024-12-19 22:29

是源程序过长的原因吗?

beyond_笑谈 发表于 2024-12-20 10:13

fcluy 发表于 2024-12-19 22:29
是源程序过长的原因吗?

<p>应该不是源程序过长的问题,看起来像是头文件或者变量名缺失。<br />
如果程序可以外传,放源代码到附件看看</p>

freebsder 发表于 2024-12-23 15:11

<p>链接器code区段定义小了吧,应该是放不下。</p>

fcluy 发表于 2024-12-31 18:57

<p>如果链接器code 区段定义小,如何改大?</p>

fcluy 发表于 2025-1-5 12:29

<p>我试着把程序缩小,在一点上仍出现错误。</p>

<p>Error &nbsp; ; . can&#39;t find 0x11 words (0x11 withtotal) for psect &quot;text4&quot; in segment &quot;CODE&quot;<br />
Error &nbsp; ; . can&#39;t find 0x11 words (0x11 withtotal) for psect &quot;text2&quot; in segment &quot;CODE&quot;</p>

fcluy 发表于 2025-1-5 12:30

<div class='shownolgin' data-isdigest='no'><p>双击错误,程序不出现错误的光标点。</p>
</div><script>showreplylogin();</script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script>

fcluy 发表于 2025-1-5 12:32

<div class='shownolgin' data-isdigest='no'><p>我仔细检查了程序,基本上排除头文件或者变量名缺失的可能性。</p>
</div><script>showreplylogin();</script>

zhukun 发表于 2025-1-11 15:05

<div class='shownolgin' data-isdigest='no'>原因是没有为CODE段分配足够的容量,如果有lcf文件,建议检查一下。印象中MAPLAB选择了芯片型号就可以了,是不是芯片没选对?</div><script>showreplylogin();</script>
页: [1]
查看完整版本: PIC 单片机 C 程序 MAPLAB 编译出错是什么原因?