我应该在哪里放置动态库(dynlib)来链接到 Cocoa 应用程序?
假设我要使用一些可通过自动工具安装在我的 Cocoa 应用程序中的库。我应该把它“放置”在哪里?我应该运行 ./configure && make
然后将 .dynlib
复制到我的 Xcode 项目中?还是执行 ./configure && 更好?制作&& sudo make install
然后配置我的项目以链接到它?在后一种情况下,Xcode 构建器是否足够聪明,可以将库复制到捆绑包中?
Suppose I am going to use some library that is installable through autotools in my Cocoa application. Where should I "place" it? Should I run ./configure && make
and then copy the .dynlib
it to my Xcode project? Or is it better to execute ./configure && make && sudo make install
and then configure my project to link to it? In the latter case, would the Xcode builder be smart enough to copy the library to the bundle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不再使用 Mac OS X。无论如何,我相信首选的解决方案是静态链接到库或将
.dynlib
包含在捆绑包中。(我尝试使用 autotools (又名
./configure && make && sudo make install
)安装库,然后将参数添加到项目配置中;结果是我的应用程序在未安装该库的任何机器上都不起作用。)I am not working with Mac OS X anymore. Anyway, I believe the preferred solution is either to link to the library statically or include the
.dynlib
in the bundle.(I tried to install the library using autotools (aka
./configure && make && sudo make install
) and then add the parameters to the project configuration; the result was that my application did not work in any machine where the library was not installed.)