5

I have a File.framework file and wish to link it against my project by using the Other Linker Flags section of the build. Its under build settings, Other Linker Flags.

Typically it has -framework Cocoa type entries, but I have a framework file I want to reference. How can I link the framework file?

2
  • What do you mean by link the framework file: link the framework, import a header file, or access some other file inside the framework? In Xcode you normally link to frameworks instead of linking to a file in a framework. To link a framework, add it to the target's Link Binary with Libraries build phase. If you're trying to access a file inside a framework, I can't help you. Commented Apr 7, 2014 at 20:37
  • 1
    Assuming File.framework isn't just a plain file but actually a framework, -framework File.framework should do the job. You will have to adjust the Framework Search Path build setting, i.e., add the path to your framework to it. I can't really test this at the moment because I don't have a non-Apple framework at hand... Commented Apr 8, 2014 at 8:39

1 Answer 1

8

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

example:-

$(PROJECT_DIR)/FOLDER_REFER_TO_FILE.FRAMEWORK

According to your need you can add it for Debug and Release configurations separately. It will work.

I have tried it with Xcode 9.2.

Sign up to request clarification or add additional context in comments.

1 Comment

this helps a lot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.