"[[ilink32]致命:内存不足".在C ++ Builder中 [英] "[ilink32] Fatal: Out of memory" in C++ Builder

查看:78
本文介绍了"[[ilink32]致命:内存不足".在C ++ Builder中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Embarcadero C ++ Builder更新到新版本后,我们的项目突然无法构建.这仅发生在我们的一个项目中.对于大多数团队成员而言,构建相同的代码不会出错.在我的计算机上,每次链接都会失败.

After updating Embarcadero C++ Builder to a new version, our project suddenly fails to build. This happens just with one of our projects. For the most of the team members, identical code builds without errors. On my computer, linking fails every time.

在构建"标签中:

[ilink32] Fatal: Out of memory

在输出"标签中:

Build FAILED.
c:\program files (x86)\embarcadero\studio\18.0\Bin\CodeGear.Cpp.Targets(3517,5): error : Fatal: Out of memory

没有更多信息.

如果启用动态RTL链接,则项目链接不会出错.例如,如果我们的调试"目标启用了该设置,则项目将在调试"中链接,但在发行版"中不链接.

If I enable Link with Dynamic RTL, the project links without errors. For example, if our Debug target has that setting enabled, the project links in Debug but not in Release.

如何解决此问题?如何给链接器更多的内存?

How can I fix this problem? How do I give more memory for the linker?

推荐答案

说明

在您的计算机上,对于此项目,链接器堆之一太小.该项目使用使用动态RTL链接选项进行链接,因为在这种情况下,链接器需要较少的内存,而堆恰好足够大.

Explanation

On your computer, one of the linker heaps is too small for this project. The project links with Link with Dynamic RTL option, because in that case the linker needs less memory, and the heap just happens to be large enough.

您可以使用 -GH 链接器选项来增加该堆,但是首先您必须找出哪些堆溢出.为此,请在链接器中启用诊断输出.

You can use -GH linker option to increase that heap, but first you have to find out which heap overflows. To do that, enable diagnostic output in the linker.

从命令行编译:

call rsvars
MSBuild /v:diag YourProject.cbproj

从IDE编译:

  • 转到工具>选项>环境选项
  • 详细程度更改为诊断
  • 构建项目后,从消息窗口的 Output 选项卡中读取输出
  • Go to Tools > Options > Environment Options
  • Change Verbosity to Diagnostic
  • After building the project, read output from the Output tab of the Messages window

在输出的结尾附近,您应该找到堆的大小,类似于:

Near the end of the output, you should find sizes of heaps, similar to this:

The "ILINK32" task is using "ilink32" from "c:\program files (x86)\embarcadero\studio\18.0\bin\ilink32.exe".
Turbo Incremental Link 6.75 Copyright (c) 1997-2016 Embarcadero Technologies, Inc.
Overrun on linker heap: tds
Linker Heaps
------------
system                 0x030d4000  0x08000000
tds                    0x08710000  0x09400000
c:\program files (x86)\embarcadero\studio\18.0\Bin\CodeGear.Cpp.Targets(3517,5): error : Fatal: Out of memory
The command exited with code 2.

在这种情况下,堆 tds 中发生了溢出,因此我们需要增加其大小.左列给出了使用中的字节数,右列给出了分配的字节数.新的大小应大于右列中当前的值.

In this case, overflow happened in heap tds, so we need to increase its size. The left column gives the number of bytes in use, and the right column gives the number of bytes allocated. The new size should be larger than the value that is currently in the right column.

在这种情况下, tds 的大小为 0x09400000 ,因此我们使用以下选项将其增大为 0x0f400000 : -GHtds =0x0f400000 .

In this case, tds size was 0x09400000, so we increase it to 0x0f400000 with the following option: -GHtds=0x0f400000.

在IDE中,转到项目>选项> C ++链接器.将 -GHtds = 0x0f400000 添加到高级>其他选项.

In the IDE, go to Project > Options > C++ Linker. Add -GHtds=0x0f400000 to Advanced > Additional Options.

保存项目选项后,再次编译项目.如果同一堆溢出,则需要进一步增加其大小.如果另一个堆溢出,则还需要增加其大小.

After saving project options, compile the project again. If the same heap overflows, you need to increase its size even more. If another heap overflows, you need to increase its size as well.

例如,如果 code 堆现在溢出,并且要将其大小增加到 0x0a000000 ,则应将其他选项更改为<代码> -GHtds = 0x0f400000 -GHcode = 0x0a000000 .

For example, if code heap overflows now, and you want to increase its size to 0x0a000000, you should change Additional Options to -GHtds=0x0f400000 -GHcode=0x0a000000.

如果过多增加堆,则会收到LME288错误.这意味着您已经达到了某些堆的最大大小.如果最大大小不足以容纳您的项目,则似乎是C ++ Builder 10.2.3.已将最大大小增加了一倍,因此您可以迁移到该版本,或从10.2.3复制 ilink32.exe .安装以与旧版本的C ++ Builder一起使用.

If you increase the heap too much, you will get LME288 error instead. That means you have reached the maximum size for some heap. If even the maximum size is not enough for your project, it seems C++ Builder 10.2.3. has doubled the maximum size, so you could migrate to that version, or copy ilink32.exe from 10.2.3. installation to use with an older version of C++ Builder.

  • 如果您使用的是C ++ Builder 10.0或10.1,请尝试按以下说明修补链接器:C ++ Builder中的LME288错误
  • 如果您使用的是C ++ Builder 10.2,则无法修补链接程序,但可以在同一链接中尝试其他解决方案
  • C ++ Builder 10.2.具有用于管理堆的设置:处理内存不足错误

这篇关于"[[ilink32]致命:内存不足".在C ++ Builder中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆