文件的指定架构类型 (arm) 与其 cputype (7) 和 cpusubtype (3) 不匹配

发布于 2024-09-10 22:46:32 字数 1083 浏览 9 评论 0原文

我尝试将 openLdap 用于我目前正在开发的 iPhone 应用程序。为了编译 openLdap,我使用 链接文本 中的 fat_build.sh。我还在 OS X 10.6.0 下使用 Simulator 3.1.3 进行开发。但在最后一步

$DEVROOT/usr/bin/lipo -arch arm lnsout/$LIBLDAP_NAME_static.arm -arch i386 lnsout/$LIBLDAP_NAME_static.i386 -create -output lnsout/$LIBLDAP_NAME_static
$DEVROOT/usr/bin/lipo -arch arm lnsout/$LIBLBER_NAME_static.arm -arch i386 lnsout/$LIBLBER_NAME_static.i386 -create -output lnsout/$LIBLBER_NAME_static

我收到以下错误:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: specifed architecture type (arm) for file (lnsout/libldap.a.arm) does not match it's cputype (7) and cpusubtype (3) (should be cputype (12) and cpusubtype (0))
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: specifed architecture type (arm) for file (lnsout/liblber.a.arm) does not match it's cputype (7) and cpusubtype (3) (should be cputype (12) and cpusubtype (0))

我尝试通过设置标头搜索路径、库搜索路径和链接器标志来修复它,但没有结果。

因此,如果您有任何想法如何解决这个问题,请告诉我!

I tried to use openLdap for my iphone app I'm developing at the moment. To compile openLdap I'm using the fat_build.sh from link text. I'm also developing with the Simulator 3.1.3 and under OS X 10.6.0. But at the last step

$DEVROOT/usr/bin/lipo -arch arm lnsout/$LIBLDAP_NAME_static.arm -arch i386 lnsout/$LIBLDAP_NAME_static.i386 -create -output lnsout/$LIBLDAP_NAME_static
$DEVROOT/usr/bin/lipo -arch arm lnsout/$LIBLBER_NAME_static.arm -arch i386 lnsout/$LIBLBER_NAME_static.i386 -create -output lnsout/$LIBLBER_NAME_static

I get following error:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: specifed architecture type (arm) for file (lnsout/libldap.a.arm) does not match it's cputype (7) and cpusubtype (3) (should be cputype (12) and cpusubtype (0))
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: specifed architecture type (arm) for file (lnsout/liblber.a.arm) does not match it's cputype (7) and cpusubtype (3) (should be cputype (12) and cpusubtype (0))

I tried to fix it by setting the Header Search Path, Library Search Path and the Linker Flags without result.

So if you have any ideas how I could solve this problem, please let me know !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋日私语 2024-09-17 22:46:32

当我为 iPhone 构建 libssh2 时,我遇到了类似的错误,经过大量搜索,我意识到我的 .arm 版本实际上是为 i386(我的 MacBook Pro)构建的。

我甚至为 ARMv6(设备)、i386(计算机)和 x86_64(模拟器)编译 libssh2,只是为了确保每个版本都正确构建。然后我使用 lipo 将arm 和x86_64 架构结合起来。我的笔记中有一条加星号的评论,“'make clean'和'make distclean'是你的朋友”,所以也许如果你首先为你的机器构建库,当你为 iPhone 构建时它仍然有配置文件。

我使用命令“lipo -info libldap.a.arm”和“file libldap.a.arm”(根据您的文件名进行修改)来查看有关构建类型的更多信息。仅供参考,一旦正确构建,这些命令就会显示架构“arm”和“x86_64”。

我注意到的最后一件事——上面的 github 链接中的代码实际上包含 libldap.a 和 liblber.a 的预编译通用二进制文件。在构建了库之后,我注意到了这一点,并将这两个文件与 ldap.h 文件一起使用,然后我就可以开始了。

I got a similar error when I was building libssh2 for iPhone, and after a lot of searching, I came to the realization that my .arm build had actually been built for i386 (my MacBook Pro).

I went so far as to compile libssh2 for ARMv6 (device), i386 (computer), and x86_64 (simulator), just to make sure each version built correctly. I then combined the arm and x86_64 architectures using lipo. I have a starred comment in my notes that "'make clean' and 'make distclean' are your friends," so perhaps if you built the library for your machine first, it still had the config file for that when you built for the iPhone.

I used the commands "lipo -info libldap.a.arm" and "file libldap.a.arm" (modified for your filenames) to see further info on the build type. FYI, once they built correctly, those commands showed the architectures "arm" and "x86_64."

One last thing I noticed--the code in the above github link actually contains pre-compiled universal binaries for libldap.a and liblber.a. After messing around building the libraries, I noticed that and just used those two files with the ldap.h file, and I was good to go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文