Ios 用于ARMv7的OSX交叉编译库
我正在尝试为iOS应用程序编译库,收到以下错误消息:Ios 用于ARMv7的OSX交叉编译库,ios,cross-compiling,Ios,Cross Compiling,我正在尝试为iOS应用程序编译库,收到以下错误消息: creating cache ./config.cache checking for gcc... /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7 checking whether the C compiler (/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7 ) wor
creating cache ./config.cache
checking for gcc... /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7
checking whether the C compiler (/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7 ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
你知道为什么armv7编译器不能创建可执行文件,但它适用于i386和x86_64吗?如何修复此错误?哪个库
我根据OpenSSL的外观猜测它(BSD-generic32
是一个信号),如果是这样,就用它来构建它
如果您有兴趣,可以在build-libssl.sh脚本中找到帮助您选择正确构建的重要信息
更新:
有时,仅指定-arch
是不够的。传递整个-target
,尤其是在编译C库或通常部署在unix类型系统上的库时,这会很有帮助
请尝试clang-target arm64 apple ios…
和clang-target armv7 apple ios…
,然后使用lipo
将库合并为一个支持多种体系结构的库
您可以使用
clang-target armv7 apple ios-dM-E-
尝试可能的目标三元组(如果您好奇的话,可以检查它们生成的定义),例如,谢谢您的回答。我修复了BSD-generic32的问题。我已经构建了OpenSSL。我现在尝试构建另一个库,它使用OpenSSL执行https请求(Tlink)。我对这一点还不熟悉,不明白为什么编译器不会为ARMv7生成可执行文件。