博客
关于我
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/

    你可能感兴趣的文章
    NOIp模拟赛二十九
    查看>>
    NOPI读取Excel
    查看>>
    NoSQL&MongoDB
    查看>>
    NoSQL介绍
    查看>>
    NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty()
    查看>>
    Now trying to drop the old temporary tablespace, the session hangs.
    查看>>
    np.arange()和np.linspace()绘制logistic回归图像时得到不同的结果?
    查看>>
    npm error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装
    查看>>
    npm install digital envelope routines::unsupported解决方法
    查看>>
    npm install 卡着不动的解决方法
    查看>>
    npm install 报错 ERR_SOCKET_TIMEOUT 的解决方法
    查看>>
    npm install 报错 no such file or directory 的解决方法
    查看>>
    npm install报错,证书验证失败unable to get local issuer certificate
    查看>>
    npm install无法生成node_modules的解决方法
    查看>>
    npm node pm2相关问题
    查看>>
    npm run build 失败Compiler server unexpectedly exited with code: null and signal: SIGBUS
    查看>>
    npm run build报Cannot find module错误的解决方法
    查看>>
    npm run build部署到云服务器中的Nginx(图文配置)
    查看>>
    npm run dev 报错PS ‘vite‘ 不是内部或外部命令,也不是可运行的程序或批处理文件。
    查看>>
    npm start运行了什么
    查看>>