通过 boost build 链接到 OS X 框架
如何使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简单的方法:
这当然假设您正在使用“darwin”工具集。并正确设置它,以便它知道您已安装的所有 SDK。
The simple way:
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.
以下内容有效,但假设您正在使用支持“-frameworks”链接器选项的编译器进行构建:
鉴于您想要链接到框架,这是一个非常合理的假设!
The following works, but assumes that you are building using a compiler which supports the "-frameworks" linker option:
This is a pretty reasonable assumption, given that you want to link to a framework!