如何为iOS构建DLIB [英] how to build DLIB for iOS

查看:1462
本文介绍了如何为iOS构建DLIB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图为iOS项目构建DLIB。运行cmake会导致 libdlib.a 和加载 .o 文件。

I'm trying to build DLIB for an iOS project. running the cmake results in a libdlib.a and a load of .o files.

当我将库添加到一个Xcode项目时,我得到警告,该库还没有为 arm64 构建。

When I add the library to an Xcode project I get warning that the library hasn't been built for arm64.

我的问题是两部分:1)如何为iOS创建DLIB(我试过 cmake ** path_to_source ** -DCMAKE_OSX_ARCHITECTURE =arm64但是它引起了很多错误,例如未知类型名称'__uint32_t';你的意思是'__uint128_t'?

My question is two part: 1) How can I build DLIB for iOS (I tried cmake **path_to_source** -DCMAKE_OSX_ARCHITECTURE="arm64" but it caused loads of errors e.g. unknown type name '__uint32_t'; did you mean '__uint128_t'?.

2)当你运行cmake时,所有 .o 文件的目的是什么?

2) What is the purpose of all the .o files that get built when you run cmake? Do I need to include them in an Xcode project?

推荐答案

我终于想出了怎么做:


要求

Requirements




  • X11在Mac上你可以打开X11应用程序,如果X11没有安装,它会带你到下载)。

  • Xcode

  • cmake(您可以使用自制程序)


  • 步骤

    Steps




    • 在终端中使 lib-xx.xx / examples li>
    • 执行:

      • In terminal make the lib-xx.xx/examples your root
      • Run:

        mkdir build

        cd build

        cmake -G Xcode。 。

        cmake --build。 --config发布

        这将创建一个名为 dlib_build ,其中可以找到编译库的Xcode项目。在Xcode项目的构建设置中,您可以为任何喜欢的Xcode支持的操作系统设置构建体系结构和SDK。

        This will create a folder called dlib_build in which you can find an Xcode project that compiles the library. In the build settings of that Xcode project you can set the build architecture and SDK for any Xcode supported OS you like!

        编辑:

        您必须包含大量自定义编译器标志和第三方库,以使dlib在项目中工作。查看 examples.xcproject 构建设置。

        You have to include a lot of custom compiler flags and 3rd party libraries to get dlib to work in a project. Check out the examples.xcproject build settings.

        这篇关于如何为iOS构建DLIB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆