Using Non-SDK or Third-Party Libraries/Frameworks

Apple imposes restrictions on linking external dynamic libraries not part of the system. The generally accepted way to include code from non-SDK dynamic libraries or third-party frameworks is to embed their code directly within your app.

There are two main approaches:

1. Static Linking (Canonical Way)

  • Compile the third-party library/framework as a static library (.a file).

  • Link this static library directly into your application. This incorporates all the necessary code from the library into your app's executable.

2. Include Source Files Directly (Simpler Option)

  • Add all the source files (.c, .cpp, .m, .swift, etc.) of the third-party library or framework directly into your project.

  • You can organize them in a subdirectory within your project.

  • The build system will then compile these source files as if they were part of your own project's codebase.

  • This method avoids external linking complexities for these components.

Further Instructions: For a practical example and more detailed instructions, please refer to the help file named How to use an external framework.txt located in the ExternalFrameworkDemo project directory that comes with the Darwin Build Environment.libraries-frameworks/non-sdk-libraries.md

Last updated