【问题标题】:Changing a C library to IOS library getting error将 C 库更改为 IOS 库出现错误
【发布时间】:2016-09-15 06:21:29
【问题描述】:

我想配置一个 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 的.?如果是的话怎么做.?任何帮助表示赞赏。

谢谢

【问题讨论】:

标签: ios c static-libraries net-snmp


【解决方案1】:

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

您可以通过运行./configure --help | grep endian获取此信息

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-23
    • 1970-01-01
    • 2013-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-13
    • 2013-05-21
    相关资源
    最近更新 更多