如何在iOS项目中使用dylib库和hpp头文件? [英] How to use dylib library and hpp header file in iOS project?

查看:131
本文介绍了如何在iOS项目中使用dylib库和hpp头文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一个 dylib 库和一个 hpp 头文件,我应该在 Xcode 的 iOS 项目中使用它们.我一直在浏览互联网,但所有答案都很简洁,没有具体步骤可遵循.

I have been given a dylib library and a hpp header file that I should use in my iOS project in Xcode. I've been looking through the internet, but all the answers are succinct and short, with no specific steps to follow.

我是否只是将这些文件复制到我的项目中?然后如何在 Obj-C 类中创建/使用库中的对象?我需要任何包装类或其他东西吗?我是否必须在构建设置或构建阶段更改某些内容?(这些是我脑海中出现的问题)

Do I just copy these files into my project? How can I then create/use an object from the library within an Obj-C class? Do I need any wrapper class or something? do I have to change something in the build settings or in build phases? (these are the kind of questions that arise in my mind)

有谁知道要遵循的步骤是什么?或者我可以做更多研究的地方?

Does anyone know what are the steps to follow? or somewhere I could make more research?

任何帮助将不胜感激.

推荐答案

  1. 使用 Finder 将您的 dylib 文件添加到您的项目文件夹中.
  2. 选择 Target,然后转到 Xcode 中的构建阶段选项卡.
  3. 选择将二进制文件与库链接".
  4. 点击 + 添加文件.
  5. 从列表中选择文件.
  6. 如果文件不在列表中,请点击添加其他",浏览到文件所在的位置并选择它.
  7. 该文件将添加到您的项目中.

这篇关于如何在iOS项目中使用dylib库和hpp头文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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