frameworks • Carthage/Cocoapods errors • Got out of problems when things go south 28.02.19 Tommaso Piazza - @tmpz https://github.com/blender - let{it}swift 2 Undefined symbols for architecture x86_64: "_thisWillTotallyBeThere", referenced from: _main in trust-me-c9e7ba.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire Referenced from: /private/var/mobile/Containers/Bundle/Application/... Reason: image not found
of bytes on disk • Used by Mach Kernels • macOS, iOS, tvOS, watchOS, GNU Hurd Tom m aso Piazza - @ tm pz https://github.com /blender - let{it}swift 28.02.19 3
https://github.com /blender - let{it}swift 28.02.19 Contains • Information about the Data part of the file • Segments LC_SEGMENT_64 • Sections in each segment • Read with • otool -l Answers • Where is the symbol table? LC_SYMTAB, • What is the minimum version of the OS? LC_VERSION_MIN_IPHONEOS • Where is main? LC_MAIN • What libraries should be loaded? LC_LOAD_DYLIB • Where is the code signature? LC_CODE_SIGNATURE 12
Read with: dsymutil –symtab <file> • LC_DYSYMTAB (dynamic symbol table, AKA symbols from other files) • Can include debug symbol • strip –SxXNT <file> Tom m aso Piazza - @ tm pz https://github.com /blender - let{it}swift 28.02.19 13
https://github.com /blender - let{it}swift 18 man ld • The binary fromthe linked library is copied into the final product • No binary share • Relatively simple process You may knowld for messages like... Undefined symbols for architecture x86_64: "_thisWillTotallyBeThere", referenced from: _main in trust-me-c9e7ba.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 28.02.19
https://github.com /blender - let{it}swift 19 man dyld • The binary from the linked library is not copied into the final product • Binary share • Address of linked symbols resolved at load time (penatly) • More complex than static linking You may know dyld for messages like... dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire Referenced from: /private/var/mobile/Containers/Bundle/Application/... Reason: image not found 28.02.19