本文共 818 字,大约阅读时间需要 2 分钟。
cd examplesmkdir buildcd buildcmake -G Xcode ..cmake --build . --config Release
如果你遇到以下错误:
CMake Error: Xcode 1.5 not supported.
请确保你使用的 Xcode 版本是最新的。打开 Xcode,进入 preferences,检查版本是否为最新。
成功编译后,进入生成的 dlib_build/Release 文件夹:
cd dlib_build/Release
检查是否生成了 libdlib.a 文件:
pwd# 应为:/Users/你的用户名/Desktop/路径/dlib_build/Releasels# 应显示:libdlib.a
打开 examples.xcproject,选择目标设备为 iOS,完成配置。
在终端中输入以下命令:
i lipo -info libdlib.a
如果显示错误信息:
input file libdlib.a is not a fat file
这意味着 libdlib.a 不是 fat 文件。检查 libdlib.a 的架构:
# 输出可能类似:Non-fat file: libdlib.a is architecture: arm64
确认编译目录:
cd /Users/你的用户名/Desktop/路径/dlib_build/Debug-iphoneos
希望以上步骤能帮助你顺利完成 dlib 的编译。如果有其他问题,请检查 Xcode 版本或 consult the dlib documentation。
转载地址:http://fyaa.baihongyu.com/