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应该可以处理!

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

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

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

最新更新