iphone app crashed with dlopen(/usr/lib/libSystem.B.dylib, 0x00000009)
iphone应用程序崩溃与dlopen(/usr/lib/libSystem.B。dylib,0 x00000009)
Console tells me that:
控制台告诉我:
SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/Celestial.framework/Celestial dlopen(/usr/lib/libSystem.B.dylib, 0x00000009).
sdk / iPhoneSimulator5.0.sdk /系统/图书馆/ PrivateFrameworks / Celestial.framework天体dlopen(/ usr / lib / libSystem.B。dylib 0 x00000009)。
When i link library libSystem.B.dylib, I receive error:
当我链接到图书馆libSystem.B。dylib,我收到错误:
ld: library not found for -lSystem.B Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed >with exit code 1
ld:未找到用于-lSystem的库。B命令/开发人员/平台/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2退出代码1的>失败
2 个解决方案
#1
3
I specify the linker flag -weak-lSystem in Xcode build settings and it works.
我在Xcode构建设置中指定链接器标志- weaklsystem,它可以工作。
#2
0
Try recreating the symlink from libSystem.B.dylib to libSystem.dylib or copying the lib into the iPhone Simulator folder from your /usr/lib
directory.
尝试从libSystem.B中重新创建符号链接。dylib libSystem。dylib或将lib从/usr/lib目录复制到iPhone模拟器文件夹。
To copy:
复制:
sudo cp -v /usr/lib/libSystem.B.dylib /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/
Or, to create a symlink instead:
或者,创建一个符号链接:
sudo ln -s /usr/lib/libSystem.B.dylib /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libSystem.B.dylib
Now, run this to verify that the symlink is created or the copy was successful:
现在,运行这个来验证是否创建了symlink或复制成功:
ls -l /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libSys*
And you should see this if you used cp
:
如果你用cp
lrwxr-xr-x 1 root wheel 107B Nov 21 19:08 libSystem.B.dylib
-rwxr-xr-x 1 root wheel 186K Sep 15 23:32 libSystem.dylib
Or, this if you used ln
:
或者,如果你用ln:
lrwxr-xr-x 1 root wheel 107B Nov 21 19:08 libSystem.B.dylib -> /usr/lib/libSystem.dylib
-rwxr-xr-x 1 root wheel 186K Sep 15 23:32 libSystem.dylib
Another idea:
另一个想法:
If you recently upgraded to Xcode 4.2, there is a bug that causes projects to "lose" some of their frameworks (meaning they still show in the project, but Xcode doesn't actually know where to find them, and it doesn't get caught until run-time). It is a fairly rare bug so this may not be what is causing your error, but it doesn't hurt to try out this fix.
Remove the Celestial
framework from your project in both the 'Build Phases' and the file hierarchy:
如果您最近升级到Xcode 4.2,会有一个错误导致项目“丢失”一些框架(这意味着它们仍然显示在项目中,但是Xcode实际上并不知道在哪里找到它们,并且直到运行时才发现)。这是一个相当罕见的错误,所以这可能不是导致错误的原因,但是尝试这个修复并没有什么坏处。在“构建阶段”和文件层次结构中从项目中删除Celestial框架:
Then add it back to your project, do a 'Clean', 'Build', and 'Run' again.
然后将其添加到项目中,进行一次“清理”、“构建”和“运行”。
#1
3
I specify the linker flag -weak-lSystem in Xcode build settings and it works.
我在Xcode构建设置中指定链接器标志- weaklsystem,它可以工作。
#2
0
Try recreating the symlink from libSystem.B.dylib to libSystem.dylib or copying the lib into the iPhone Simulator folder from your /usr/lib
directory.
尝试从libSystem.B中重新创建符号链接。dylib libSystem。dylib或将lib从/usr/lib目录复制到iPhone模拟器文件夹。
To copy:
复制:
sudo cp -v /usr/lib/libSystem.B.dylib /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/
Or, to create a symlink instead:
或者,创建一个符号链接:
sudo ln -s /usr/lib/libSystem.B.dylib /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libSystem.B.dylib
Now, run this to verify that the symlink is created or the copy was successful:
现在,运行这个来验证是否创建了symlink或复制成功:
ls -l /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libSys*
And you should see this if you used cp
:
如果你用cp
lrwxr-xr-x 1 root wheel 107B Nov 21 19:08 libSystem.B.dylib
-rwxr-xr-x 1 root wheel 186K Sep 15 23:32 libSystem.dylib
Or, this if you used ln
:
或者,如果你用ln:
lrwxr-xr-x 1 root wheel 107B Nov 21 19:08 libSystem.B.dylib -> /usr/lib/libSystem.dylib
-rwxr-xr-x 1 root wheel 186K Sep 15 23:32 libSystem.dylib
Another idea:
另一个想法:
If you recently upgraded to Xcode 4.2, there is a bug that causes projects to "lose" some of their frameworks (meaning they still show in the project, but Xcode doesn't actually know where to find them, and it doesn't get caught until run-time). It is a fairly rare bug so this may not be what is causing your error, but it doesn't hurt to try out this fix.
Remove the Celestial
framework from your project in both the 'Build Phases' and the file hierarchy:
如果您最近升级到Xcode 4.2,会有一个错误导致项目“丢失”一些框架(这意味着它们仍然显示在项目中,但是Xcode实际上并不知道在哪里找到它们,并且直到运行时才发现)。这是一个相当罕见的错误,所以这可能不是导致错误的原因,但是尝试这个修复并没有什么坏处。在“构建阶段”和文件层次结构中从项目中删除Celestial框架:
Then add it back to your project, do a 'Clean', 'Build', and 'Run' again.
然后将其添加到项目中,进行一次“清理”、“构建”和“运行”。