- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
在尝试为 iphoneos、Xcode4 编译虚拟程序时,gcc 似乎没有超出初始 sysroot 目录
$ echo $ISYSROOT
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
$ gcc -arch armv6 --sysroot=$ISYSROOT test.cpp
ld: in /usr/lib/system/libcache.dylib, missing required architecture armv6 in file for architecture armv6
collect2: ld returned 1 exit status
如果我省略 sysroot,
$ gcc -arch armv6 test.cpp
ld: warning: ignoring file /usr/lib/crt1.o, missing required architecture armv6 in file
ld: warning: ignoring file /usr/lib/libgcc_s.1.dylib, missing required architecture armv6 in file
ld: warning: ignoring file /usr/lib/libSystem.dylib, missing required architecture armv6 in file
Undefined symbols for architecture armv6:
"start", referenced from:
-u command line option
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status
下面的工作,但感觉很俗气,不可扩展。这是怎么回事?
$ gcc -arch armv6 -L$ISYSROOT/usr/lib/system --sysroot=$ISYSROOT test.cpp
更新。显然这是一个已知问题,尽管仍然不清楚如何将 sysroot 传递给 gcc 而将 isysroot 传递给 ld
http://www.doitscared.com/?m=201104
When compiling the library, if you see this error “ld: file not found: /usr/lib/system/libcache.dylib for architecture armv7″, then your linker command is using “–sysroot” which doesn’t work in Xcode 4. Instead, change the linker command to use “-isysroot”. (Note: This only applies to the linker command. The compile commands must continue to use “–sysroot”. See here for more details.)
最佳答案
将项目的部署目标更改为至少 4.3,它会起作用。这是 XCode 4 的问题,但实际上不需要将应用程序部署到 4.3 之前的 iOS 版本。 iOS 用户往往会及时更新他们的 iOS 版本。
关于ios - 在/usr/lib/system/libcache.dylib 中,缺少所需的架构 armv6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9894170/
在尝试为 iphoneos、Xcode4 编译虚拟程序时,gcc 似乎没有超出初始 sysroot 目录 $ echo $ISYSROOT /Applications/Xcode.app/Conten
我是一名优秀的程序员,十分优秀!