nios ii编译错误之“couldn't allocate heap, Win32 error 487”

本文记录了在Windows 7系统下使用Quartus II 9.0编译Nios II程序时遇到的错误及解决方案。通过调整兼容性设置并修改某些配置后,虽然问题仍未完全解决,但出现频率显著降低。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

系统是win7,来源于“MSDN-我告诉你”的“cn_windows_7_ultimate_with_sp1_x86_dvd_u_677486”。

软件是“Quartus II9.0”和配套的“nios II9.0”,编译最基本的“hello_world”程序出了错误,程序如下:

#include <stdio.h>

int main()
{
  printf("Hello from Nios II!\n");

  return 0;
}

编译后的错误如下:

**** Build of configuration Debug for project hello_world ****

make -s all includes
      4 [main] ? (3760) c:\altera\90\quartus\bin\cygwin\bin\sh.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0x680000, top 0x690000, reserve_size 61440, allocsize 65536, page_const 4096
      2 [main] sh 4420 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11
/bin/sh: fork: Resource temporarily unavailable
cygpath: can't convert empty path
C:/altera/90/nios2eds/components/altera_hal/build/app_rules.mk:153: /components/altera_hal/build/gnu_rules.mk: No such file or directory
C:/altera/90/nios2eds/components/altera_hal/build/app_rules.mk:157: /components/altera_hal/build/gtf_rules.mk: No such file or directory
make: *** No rule to make target `/components/altera_hal/build/gtf_rules.mk'.  Stop.
Build completed in 5.554 seconds

很多人都说是win7 兼容性的问题。在黑金动力社区以及Altera Forum上都推荐下面这种解决方式:

Under your Quartus II folder, go to bin->cygwin->bin folder, select the following files in the list below and then right-click and choose Properties.

Under the Compatibility tab, check“Run this program in compatibility mode for:” and choose “Windows XP (Service Pack 2)”.

Check “Run this program as an administrator”, as well.

Here is the list of files that you can select to change their compatibility mode under theQuartus II->bin->cygwin->bin folder:

1. Make.exe

2. Sh.exe

3. Echo.exe

4. Cygstart.exe

5. MakeInfo.exe

6. Perl.exe

7. Collect2.exe(under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\libexec\gcc\nios2-elf\3.4.6)

8. Nios2-elf-g++.exe(under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\bin)

但是我按照这种方法设置了以后,发现问题有时会存在,有时不会,为此我把杀毒软件关闭了,本人使用的是金山毒霸。同时我把文件夹的只读属性去掉了。在此之后第一次Bulid Project,就出现了令我满意的界面,如下:

**** Build of configuration Debug for project hello_world ****

make -s all includes
Build completed in 23.386 seconds

但我不放心,又多试了几次,结果是涛声依旧啊,不过问题出现的频率明显小了很多。也可以将就着用,嘿嘿!

但我想知道这种问题是由什么原因引起的,到底该如何解决。为此,我查询了win32-error-code,文中写到“code,487;Description,Attemp to access invalid address;Name,ERROR_INVALID_ADDRESS”,意思是说该错误指试图访问无效地址。这一毛病暂且到此吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值