将 C 库更改为 IOS 库出错

Changing a C library to IOS library getting error

我想配置一个 c 库来使用 Xcode。我对此很陌生,找不到太多关于此的信息。首先,我尝试创建一个静态库来拖放所有 c 文件,但它没有用,因为它有依赖性。我试图更改为 iOS 的图书馆是 net-snmp 。进一步调查我发现我们可以使用 configure , make 命令将 c 库更改为 iOS 特定。我按照教程尝试在终端中使用以下命令进行配置,但最终出现错误。

./configure --disable-shared --enable-utf8 --host=arm-apple-darwin CFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk" CXXFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk" LDFLAGS="-L." CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc" CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++"

错误是

configure: error: You are cross-compiling, but you have not specified the target's endianness

我不确定我在正确的轨道上。如果有人成功地将 c 库更改为 iOS 特定的。?如果是,该怎么做。?感谢您的帮助。

谢谢

您可以将另一个参数传递给配置脚本:--with-endianness=little。 (据我所知,iOS在little endian平台上运行)

您可以通过运行./configure --help | grep endian

获取此信息