xcode dyld:库未加载:/usr/lib/libc++abi.dylib
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8178287/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
dyld: Library not loaded: /usr/lib/libc++abi.dylib
提问by bTagTiger
I've build my project on xcode 4.2.
我已经在 xcode 4.2 上构建了我的项目。
I selected iPhone 4.3 simulator and build the project.
我选择了 iPhone 4.3 模拟器并构建了项目。
Then the error occured.
然后错误发生了。
dyld: Library not loaded: /usr/lib/libc++abi.dylib
Referenced from: /Users/Player/Library/Application Support/iPhone Simulator/4.3.2/Applications/CF49143F-07C9-4609-AADB-82DD3AEAF6D9/Mahjang.app/Mahjang
Reason: image not found
How can I solve this problem?
我怎么解决这个问题?
Need your help.
需要你的帮助。
回答by turon
I ran into this too: installed XCode 4.2 on Snow Leopard, and ran my app on the simulator. 5.0 simulator works, but forces it into Portrait mode (separate issue). The immediate problem was all the 4.x simulators that worked fine under XCode 4.1 would boot the app to the Default.png splash screen, and then just crash, with the disassembly showing:
我也遇到了这个问题:在雪豹上安装了 XCode 4.2,并在模拟器上运行了我的应用程序。5.0 模拟器工作,但强制它进入纵向模式(单独问题)。直接的问题是所有在 XCode 4.1 下运行良好的 4.x 模拟器都会将应用程序引导到 Default.png 启动画面,然后只是崩溃,反汇编显示:
int 3
nop
And the stack trace showing __dyld_dyld_fatal_error. Looking in gdb showed the most useful information posted in the question above.
以及显示 __dyld_dyld_fatal_error 的堆栈跟踪。查看 gdb 显示了上面问题中发布的最有用的信息。
Copying that llvm link to libc++abi.dylib into /usr/lib works, but there is a safer solution:
将指向 libc++abi.dylib 的 llvm 链接复制到 /usr/lib 可以工作,但有一个更安全的解决方案:
Answer:Add -Wl,-no_implicit_dylibsto "Other Linker Flags"in your build settings.
答案:在构建设置中将 -Wl,-no_implicit_dylibs添加到“其他链接器标志”。
回答by deathbytes
This is what I found out. Download zip from the below URL.
这是我发现的。从以下 URL 下载 zip。
http://howardhinnant.github.io/libcppabi.zip
http://howardhinnant.github.io/libcppabi.zip
cp cxxabi.h to /usr/include, and cp libc++abi.dylib to /usr/lib. Now your simulator should work.
cp cxxabi.h 到 /usr/include,cp libc++abi.dylib 到 /usr/lib。现在你的模拟器应该可以工作了。
The URL seems a little funky to me, being a very non-offical location. But I got it from http://libcxx.llvm.org/so I'm going to say it is trustworthy. Don't know what the story is here with why this is necessary.
该 URL 对我来说似乎有点时髦,因为它是一个非常非官方的位置。但我是从http://libcxx.llvm.org/得到的,所以我要说它是值得信赖的。不知道这里有什么故事以及为什么这是必要的。