通过 boost build 链接到 OS X 框架

发布于 2024-10-29 04:42:56 字数 670 浏览 2 评论 0原文

如何使用 boost build 链接到 OS X 框架?我已经尝试了以下操作(在 Jamroot 中):

frameworks_directory = "/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/" ;

lib CoreFoundation
:
: <file>$(frameworks_directory)"CoreFoundation.framework/CoreFoundation"
:
: <include>$(frameworks_directory)"CoreFoundation.framework/Headers/" ;

exe Test : main.cpp CoreFoundation ;

但是,这会产生以下错误(缩短空间):

error: target { /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation. } has no type

我认为这是因为 CoreFoundation 文件没有扩展名,因此 boost-build 无法推断其类型。有没有办法显式指定文件的类型,或者以其他方式链接到 OS X 上的框架?

How do I link to an OS X framework using boost build? I have tried the following (in Jamroot):

frameworks_directory = "/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/" ;

lib CoreFoundation
:
: <file>$(frameworks_directory)"CoreFoundation.framework/CoreFoundation"
:
: <include>$(frameworks_directory)"CoreFoundation.framework/Headers/" ;

exe Test : main.cpp CoreFoundation ;

However this produces the following error (shortened for space):

error: target { /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation. } has no type

I presume this is because the CoreFoundation file does not have an extension, and so boost-build is unable to deduce its type. Is there any way to explicitly specify the type of a file, or to in some other way link to a framework on OS X ?

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

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

发布评论

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

评论(2

时光磨忆 2024-11-05 04:42:56

简单的方法:

exe Test : main.cpp : <framework>CoreFoundation ;

这当然假设您正在使用“darwin”工具集。并正确设置它,以便它知道您已安装的所有 SDK。

The simple way:

exe Test : main.cpp : <framework>CoreFoundation ;

This is of course assuming you are using the "darwin" toolset. And have set it up correctly such that it knows about all the SDKs you have installed.

安静 2024-11-05 04:42:56

以下内容有效,但假设您正在使用支持“-frameworks”链接器选项的编译器进行构建:

alias CoreFoundation : : : : <linkflags>"-framework CoreFoundation" ;

exe Test : main.cpp CoreFoundation ;

鉴于您想要链接到框架,这是一个非常合理的假设!

The following works, but assumes that you are building using a compiler which supports the "-frameworks" linker option:

alias CoreFoundation : : : : <linkflags>"-framework CoreFoundation" ;

exe Test : main.cpp CoreFoundation ;

This is a pretty reasonable assumption, given that you want to link to a framework!

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