简体   繁体   English

如何使用 XCode 中的链接器标志链接 File.framework 文件?

[英]How to link a File.framework file using linker flags in XCode?

I have a File.framework file and wish to link it against my project by using the Other Linker Flags section of the build.我有一个 File.framework 文件,并希望通过使用构建的其他链接器标志部分将它链接到我的项目。 Its under build settings, Other Linker Flags.它在构建设置下,其他链接器标志。

Typically it has -framework Cocoa type entries, but I have a framework file I want to reference.通常它具有 -framework Cocoa 类型条目,但我有一个要引用的框架文件。 How can I link the framework file?如何链接框架文件?

Try the following.请尝试以下操作。

Add the following in Other Linker Flags其他链接器标志中添加以下内容

-framework <Framework Name>  // avoid extension .Framework, just the name.

In your case it will be在你的情况下,它将是

- framework File

Then add appropriate path to your framework in Library Search Paths然后在Library Search Paths 中为您的框架添加适当的路径

example:-例子:-

$(PROJECT_DIR)/FOLDER_REFER_TO_FILE.FRAMEWORK

According to your need you can add it for Debug and Release configurations separately.根据您的需要,您可以分别为DebugRelease配置添加它。 It will work.它会起作用。

I have tried it with Xcode 9.2.我已经用 Xcode 9.2 试过了。

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

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