在系统中安装我编译的库以供可执行文件使用

发布于 2024-09-07 17:40:04 字数 310 浏览 4 评论 0原文

我正在使用 Xcode,经过一番努力,它现在正在编译我的动态库 okie dokie。

我现在的问题是我需要将这些库与另一个项目(即可执行文件)一起使用。

我希望 Xcode 在编译我的库后,将它们复制到可执行文件夹,或者更好的是,将库复制到系统目录,在那里它们将被加载,而无需再次编译(从而复制)库

有一个在项目设置中安装目录,默认为 /usr/local/lib ,但我什至在 /usr 处没有名为 local 的文件夹(我尝试通过终端访问它),所以我猜这不起作用无论如何...

任何帮助表示赞赏!

谢谢,
乔纳森

I am using Xcode and, after some struggling, it is compiling my dynamic libraries okie dokie for now.

My kinda-problem now is that I need to use those libs with another project, that is an executable.

I would like that Xcode, after compiling my libs, copy them to the executable folder, or, better, copy the libs to a system directory, where they would be loaded without having to compile(thus copying) the libs over again

There is a Install Directory in the project's settings, the default is /usr/local/lib, but I don't even have a folder called local at /usr (I tried to reach it through the terminal), so I guess this isn't working at all...

any help is appreciated!

Thanks,
Jonathan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落日海湾 2024-09-14 17:40:04

也许“复制文件”构建阶段可以为您做到这一点。选择“绝对路径”,然后选择“仅在安装时”。

啊,这是您想要的文档(介绍后的第一部分,“构建位置”):

http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/210-Building_Products/building.html

不过,如果您想要即使在进行调试构建时也安装在“安装位置”中的库,那么“复制文件”构建阶段可能会更好。

我自己没有这样做过,但这些是直接浮现在脑海中的事情。

Perhaps the "Copy Files" build phase can do this for you. Select "Absolute Path" and then maybe "only when installing".

Ah, so here's the documentation you want (first section after intro, "Build Locations"):

http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/210-Building_Products/building.html

Though if you want the libraries installed in the "install location" even when doing debug builds, then the "Copy Files" build phase might end up being better.

Haven't done this myself but those are the things that come to mind directly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文