博客
关于我
macos上使用xcode编译dlib给ios使用
阅读量:274 次
发布时间:2019-03-01

本文共 818 字,大约阅读时间需要 2 分钟。

dlib 在 macOS 上编译指南

安装依赖

  • 首先,下载并解压 dlib 的最新版本。
  • 打开终端,切换到 dlib 的源代码目录,安装相关依赖:
  • cd examplesmkdir buildcd buildcmake -G Xcode ..cmake --build . --config Release

    常见错误

    CMake 错误:Xcode 1.5 不支持

    如果你遇到以下错误:

    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

    Xcode 配置

    打开 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/

    你可能感兴趣的文章
    python-ros No module named PyKDL
    查看>>
    python-social-auth 是否需要会话
    查看>>
    Python再获年度编程语言,微软或成最大赢家
    查看>>
    python-week5
    查看>>
    Python写表情包搜索工具(非常详细)零基础入门到精通,收藏这一篇就够了
    查看>>
    Python-【1】配置
    查看>>
    Python-从子文件夹执行绝对导入
    查看>>
    Python-刷新页面,直到元素可单击
    查看>>
    PYTHON-唤醒+VOSK+DEEPSEEK+离线合成-实现纯离线大模型问答
    查看>>
    Python-在Dash回调中重用函数
    查看>>
    PYTHON-基本数据类型-元祖类型,字典类型,集合类型
    查看>>
    python-外观模式
    查看>>
    Python-如何使用FastAPI和uvicorn.run而不阻塞线程?
    查看>>
    Python-字典
    查看>>
    python-字符串
    查看>>
    Python-将二进制遮罩转换为多边形
    查看>>
    python-文件操作
    查看>>
    PYTHON-模块 sys os random shutil-练习
    查看>>
    Python-模块与包的管理
    查看>>
    PYTHON-模块定义 搜索路径
    查看>>