简体   繁体   English

dylib应用程序捆绑

[英]Application bundle with dylib

ALL, 所有,

First of all every question on the topic are about deployment the ready to use application. 首先,关于该主题的每个问题都与部署即用型应用程序有关。 My situation is different. 我的情况不同。

I am developing the application on Mac with Xcode 5.1.1 (meaning I'm still writing code) with C++. 我正在使用C ++的Xcode 5.1.1在Mac上开发应用程序(这意味着我仍在编写代码)。 My application contains the main binary executable (which is set as Cocoa bundle application) and couple of dylib libraries (which I'm writing and have control over). 我的应用程序包含主要的二进制可执行文件(设置为Cocoa bundle应用程序)和几个dylib库(我正在编写并且可以控制它们)。

The trouble comes from the fact that at some point I would like to test my code. 问题出在某个时候我想测试我的代码。 My project for the main application in the "Build Phases->Link Binary With Libraries" references the libraries the binary uses and the dylib's have their dependencies there. 我的主要应用程序项目在“构建阶段->使用库链接二进制文件”中,引用了二进制文件所使用的库,而dylib则在其中具有依赖项。

Now when I'm trying to call dlopen, the call fails because the dylib files can not be found. 现在,当我尝试调用dlopen时,调用失败,因为找不到dylib文件。

So my questions are: 所以我的问题是:

  1. Should dylib files be stored in the bundle? 是否应将dylib文件存储在捆绑软件中?
  2. If yes - how do I put them there? 如果是,我该怎么把它们放在那里? Because I presume that whatever I did is not enough. 因为我认为我所做的一切还不够。
  3. If not - what is the correct way of testing the code? 如果不是,测试代码的正确方法是什么?

Thank you for any information you can provide. 感谢您提供的任何信息。

The Dylibs are not stored in the app bundle but they are compiled with the app and are included with the binary executable, to include them just add them to Target Dependencies and Link With Libraries in "Build Phases" there is no need for dlopen Dylib没有存储在应用程序捆绑包中,而是与应用程序一起编译并包含在二进制可执行文件中,要将它们包括在内,只需将它们添加到Target Dependencies “ Build Phases”中的库链接 ,就不需要dlopen

and include the headers like: 并包含以下标题:

#include "Dylib.h"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM