Linking custome structure to library in xcode

I want to include photoPay 417 in my library. The library project compiles and works fine, but when I use the MyLibrary.a file in my application, I have an "undefined for armv7 architecture" error. Any ideas? Is it possible to include the custome library in the library or is it not possible.

+3


source to share


2 answers


Trojanfoe answer is correct for your case. But in general the answer depends on the type of library within the framework.

The iOS / macOS framework is just a collection of a library along with all the related header files. This makes it much easier to include the library in other projects, as the entire infrastructure can be included at once, eliminating the need to change the search paths for links and linker headers and flags.

The library itself can be either a static library or a dynamic / shared library. The Framework can contain any type of library, there is no limitation.

If a library in the framework is static, then all objects from this library are copied to the target product at compile time. If the target product is a static library (MyLibrary.a in your case), no additional structuring in the application is needed because all objects are contained in MyLibrary.a



If a library in a framework is dynamic, objects from that library are loaded at load time or at runtime, not at compile time. Because of this, frameworks of this type must also be bundled with end applications.

In your case, the pdf417 framework contains a dynamic library, which means that you will also have to include this framework in your final application.


I am a developer at pdf417.mobi . The point is that we can provide our library in any format. The format we have chosen in our Github repository is .embeddedframework, which contains the dynamic library along with all the resource files, because it makes it very easy to include the framework in application projects. If you have a use case that requires a different format, we invite you to contact us at www.pdf417.mobi/#support

+1


source


A static library is just a collection of object files (a bit like a zip file with no compression or hierarchy) and cannot contain information about any dependencies it may have.



Therefore, you need to link the final executable binary with both your library and the dependent environment. The same applies if the dependency was a static library, dynamic link library, or framework.

0


source







All Articles