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

来源:互联网 发布:舜禹之事 吾知之矣 编辑:程序博客网 时间:2024/06/05 02:48

系统是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”,意思是说该错误指试图访问无效地址。这一毛病暂且到此吧!

原创粉丝点击