Xcode 链接器错误:无法分配区域
我想在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确定在链接时遇到错误,并且没有成功链接、安装并开始运行,然后出现错误吗?
你遇到的错误是因为 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.