Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting issue while using .framework which have .a static library inside it

I have .framework file which was working prior including another .a/.framework files in it.

My framework build successfully but after adding my .framework file to another project it is not working.

After adding other .a and .framework file in my frameworks build phases, I am getting this error.

0  0x103014342  __assert_rtn + 144
1  0x10307d28e  ld::tool::OutputFile::addressOf(ld::Internal const&, ld::Fixup const*, ld::Atom const**) + 262
2  0x10307ef54  ld::tool::OutputFile::applyFixUps(ld::Internal&, unsigned long long, ld::Atom const*, unsigned char*) + 3712
3  0x103083693  ld::tool::OutputFile::writeAtoms(ld::Internal&, unsigned char*) + 489
4  0x10307c59e  ld::tool::OutputFile::writeOutputFile(ld::Internal&) + 818
5  0x10307669c  ld::tool::OutputFile::write(ld::Internal&) + 178
6  0x1030151c0  main + 1164
7  0x7fff8d04c5ad  start + 1
A linker snapshot was created at:
/tmp/SDKsIntegrated_Test-2016-03-01-190200.ld-snapshot
ld: Assertion failed: (_mode == modeFinalAddress), function finalAddress, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-253.9/src/ld/ld.hpp, line 749.
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please note before adding other .a and .framework files it is working.

Note: I'm doing the almost same thing appodeal.com does. Thanks community.

like image 745
Mohammad Zaid Pathan Avatar asked Apr 01 '16 13:04

Mohammad Zaid Pathan


People also ask

How can I use an .a static library in Swift?

Yes, you can use static libraries in Swift. Go to your Build Phases and under "Link Binary With Libraries" and add them there. Alternatively, you can go under Build Settings and in "Search Paths" append the "Library Search Paths" value to include the path to the folder that your . a file is in.

Is XCFramework dynamic or static?

An XCFramework can be either static or dynamic and can include headers.

Is .LIB a static library?

Static Linking creates larger binary files, and need more space on disk and main memory. Examples of static libraries (libraries which are statically linked) are, . a files in Linux and . lib files in Windows.

How do I link a static library?

Static libraries are created by copying all necessary library modules used in a program into the final executable image. The linker links static libraries as a last step in the compilation process. An executable is created by resolving external references, combining the library routines with program code.


1 Answers

As mentioned here, the same problem was solved by changing the "Strip Style" from "All Symbols" to "Non-Global Symbols", allowing the Global Symbols to be used in categories.

like image 71
bzz Avatar answered Sep 28 '22 07:09

bzz