Xcode 链接器错误:无法分配区域

发布于 2024-12-04 15:51:30 字数 419 浏览 1 评论 0原文

我想在 iPad2 上运行一个应用程序,但在链接时出现此错误:

collect2: ld terminated with signal 6 [Abort trap]
ld(69392) malloc: *** mmap(size=16777216) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
terminate called after throwing an instance of 'std::bad_alloc'
what():  std::bad_alloc

我不知道此错误的原因是什么。看起来分配了 16777216 字节 (16MB),iPad2 应该可以处理这个问题!

I want to run an app on the iPad2 but at linking I got this error:

collect2: ld terminated with signal 6 [Abort trap]
ld(69392) malloc: *** mmap(size=16777216) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
terminate called after throwing an instance of 'std::bad_alloc'
what():  std::bad_alloc

I dont know whats the reason for this error. It look like allocating 16777216 bytes (16MB) and the iPad2 should handle that!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长发绾君心 2024-12-11 15:51:30

您确定在链接时遇到错误,并且没有成功链接、安装并开始运行,然后出现错误吗?

你遇到的错误是因为 malloc 无法分配另一个 16M 块,这几乎可以肯定是因为你要么有疯狂的内存碎片(可能,但不常见),要么内存泄漏(很常见!)

看到它会很奇怪这来自链接器/XCode 工具(除非您正在运行 betaware,在这种情况下谁知道?!)它更有可能出现在您的应用程序中。

Are you sure you got the error at linking, and that it didn't successfully link, install and begin to run, THEN get the error?

The error you have is because malloc can't allocate another 16M block, and THAT is almost certainly because you have either crazy memory fragmentation (possible, but not as common) or a memory leak (very common!)

It would be odd to see this coming form the linker/XCode tools (unless you're running betaware, in which case who knows?!) It's more likely in your app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文