gpt4 book ai didi

ios - 在/usr/lib/system/libcache.dylib 中,缺少所需的架构 armv6

转载 作者:技术小花猫 更新时间:2023-10-29 10:40:22 25 4
gpt4 key购买 nike

在尝试为 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com