Use dyld to link in frameworks at runtime. Use ld to make your programs and link archive libraries at build time.

Linker Documentation

Pinned Posts

Posts under Linker tag

162 Posts
Sort by:
Post not yet marked as solved
3 Replies
355 Views
Hello, I'm facing a crash on launch for my program. This has been a recent find since upgrading to Xcode 15.1 and using new ld_prime linker. I am able to launch my release build which has different optimization flags. I'm not using any Diagnostics options in my program scheme. The error I get is about a system framework not being found. When I look up these file locations the framework found in System/Library is there but the one in /private/preboot/Cryptexes/OS is missing. I'm running with --verbose linker/build flags but I don't get any more info than this (no warnings during build either). dyld[439]: Library not loaded: /System/Library/Frameworks/Foundation.framework/Foundation Referenced from: <XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX> /private/var/containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/application.app/application Reason: tried: '/System/Library/Frameworks/Foundation.framework/Foundation' (no such file), '/private/preboot/Cryptexes/OS/System/Library/Frameworks/Foundation.framework/Foundation' (no such file), '/System/Library/Frameworks/Foundation.framework/Foundation' (no such file, no dyld cache) These look like system files so I would appreciate some assistance in finding why the framework in the Cryptexes directory is missing. Thank you!
Posted Last updated
.
Post not yet marked as solved
1 Replies
387 Views
I'm struggling with compiling lib opus so that it works in the simulator on Apple silicon. I found a thread on the forums that seems to address part of the issue, but I am unable to build the static lib so that it shows the platform it is targeting. The thread mentions that I should be able to run otool and see a "load commands" that indicate the platform. When I run otool against the static library that we have created, it doesn't list any load commands. I don't see LC_BUILD_VERSION or LC_VERSION_MIN_***. Why would there not be any "Load command" entries? % otool -l -arch arm64 dependencies/lib/libopus.a Archive : dependencies/lib/libopus.a dependencies/lib/libopus.a(bands.o): is an LLVM bit-code file dependencies/lib/libopus.a(celt.o): is an LLVM bit-code file dependencies/lib/libopus.a(celt_encoder.o): is an LLVM bit-code file dependencies/lib/libopus.a(celt_decoder.o): is an LLVM bit-code file ... dependencies/lib/libopus.a(mlp.o): is an LLVM bit-code file dependencies/lib/libopus.a(mlp_data.o): is an LLVM bit-code file The static library has the two architectures embedded in it, but when compiling the framework for the simulator platform the linking phase complains that we are building for the simulator, but linking object code built for ios. % lipo -info dependencies/lib/libopus.a Architectures in the fat file: dependencies/lib/libopus.a are: x86_64 arm64 In case you are curious, I'm just piggybacking on this project that has a build-libopus.sh script in the root directory that builds the official open source Opus library files. My hope is to build this static library for ios, ios-simulator, and mac-catalyst platforms and then include them in a xcframework.
Posted
by tethridge.
Last updated
.
Post not yet marked as solved
3 Replies
735 Views
I have a demo app to explain how mergeable libraries work and I am stuck when archiving. I have: Project Demo App Target Framework A Framework B External Framework Project C (sub-project to Project Demo) Framework C I have all three frameworks in the demo project's dependencies, linking and embedding. Implicitly find dependencies is OFF (because that is how the actual app I will be applying this to is built) I can build to sim/device for Debug and for Release. It all works. I can find my embedded resources. I have checked the binaries with otool -l and I can see where frameworks are loaded in Debug but not in Release. Yay! But when I Archive the app, I get an error only for my External framework (not in the same project as the app) that it cannot find the file ExternalC.framework/ExternalC, even though if I copy the path, the file exists. Build input file cannot be found: '/Users/MYUSER/Library/Developer/Xcode/DerivedData/MergeableLibrariesDemo-afgemdngqmoznfhczuxrqzkeulhb/Build/Intermediates.noindex/ArchiveIntermediates/MergableLibraries/BuildProductsPath/Release-iphoneos/ExternalC.framework/ExternalC'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'MergeableLibrariesDemo' from project Here are the linker commands for the three frameworks: -Xlinker -merge_library -Xlinker /Users/MYUSER/Library/Developer/Xcode/DerivedData/MergeableLibrariesDemo-afgemdngqmoznfhczuxrqzkeulhb/Build/Intermediates.noindex/ArchiveIntermediates/MergableLibraries/BuildProductsPath/Release-iphoneos/ExternalC.framework/ExternalC -Xlinker -merge_framework -Xlinker SameProjectA -Xlinker -merge_framework -Xlinker SameProjectB Oh ExternalC.framework is an alias to the framework in the Uninstalled Products path This is only an issue if ExternalC has this set: //:configuration = Debug MERGEABLE_LIBRARY = YES //:configuration = Release MERGEABLE_LIBRARY = YES //:completeSettings = some MERGEABLE_LIBRARY Any clues as to what I might have misconfigured? Steve
Posted Last updated
.
Post not yet marked as solved
0 Replies
319 Views
My team is building an SDK to release to game developers. Does our SDK require to meet the same IOS App store submission checklist? Wondering if there is any SDK checklist for IOS
Posted
by Apeachie.
Last updated
.
Post not yet marked as solved
3 Replies
379 Views
I have a class category declared and compiled in a mac os static lib: #import <Foundation/Foundation.h> @interface NSNumber(MyExtension) -(NSString *)CallMe; @end then this staticLib is added to a mac console app in XCode and used: #import <Foundation/Foundation.h> #import "MacStaticLib.h" int main(int argc, const char * argv[]) { @autoreleasepool { NSNumber *one = [NSNumber numberWithInt:12]; NSLog(@"%@",[one CallMe]); } return 0; } Compiles fine but fails in runtime, unrecognized selector 'CallMe' send to instance... what's wrong or what I missed? Thanks!!
Posted
by wirex.
Last updated
.
Post not yet marked as solved
1 Replies
300 Views
I am upgrading the react-native from 71 to 73. Once Ios is built successfully and its been installed on the simulator, its throwing an error "Command Ld emitted errors but did not return a nonzero exit code to indicate failure". I did the following trying to resolve it but nothing worked so far. deleted derived data pod deintegrate pod install clean project Any help is appreciated.
Posted Last updated
.
Post marked as solved
22 Replies
7.2k Views
Hi, I wanted to compile a project (For the compilation I used gcc-13 from home-brew) and I got the following error from the linker: 0 0x100e0f648 __assert_rtn + 72 1 0x100d43fac ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1204 2 0x100d59924 ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 15164 3 0x100d66e30 ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 420 4 0x1a95f0440 _dispatch_client_callout2 + 20 5 0x1a9603f1c _dispatch_apply_invoke + 224 6 0x1a95f0400 _dispatch_client_callout + 20 7 0x1a9601fb8 _dispatch_root_queue_drain + 684 8 0x1a96026c0 _dispatch_worker_thread2 + 164 9 0x1a979c038 _pthread_wqthread + 228 ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336. collect2: error: ld returned 1 exit status I am using a MacBook Pro M2 (Ventura 13.5.2 (22G91)) and the CommandLineTools version 15.0. I have read through some earlier posts about linker issues, which were solved by downgrading Xcode. After downgrading to 14.3.0 I was able to compile the code. Did anyone run into the same Problem? If so, is there a better solution for this? Best regards
Posted Last updated
.
Post marked as solved
1 Replies
519 Views
Hello, I'm currently facing an issue after adding the HaishinKit framework to my project, and I require immediate assistance. I’ve seen many questions regarding this kind of log but haven’t found any solution that fixes this problem. My project is extensive, consisting of multiple modules and projects. Specifically, I have a module named TelegramUI where the HaishinKit framework has been successfully added and is functioning correctly. Now, I'm trying to add the same framework to another module called Social. I used Swift Package Manager to add the framework, providing the GitHub link and selecting the same version as in TelegramUI. After successfully building the app, it crashes upon launch, and I received the following log. It's worth noting that when I remove the framework from the Social module, everything works normally again. dyld[490]: Library not loaded: @rpath/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct Referenced from: <68034630-FB0B-34CA-B6E6-45967056914E> /private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/TelegramUI.framework/TelegramUI Reason: tried: '/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/TelegramUI.framework/Frameworks/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file)Library not loaded: @rpath/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct Referenced from: <88CED3C3-284D-3F63-9AB2-585C5F26E4C0> /private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/SocialUI.framework/SocialUI Reason: tried: '/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/SocialUI.framework/Frameworks/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file), '/private/var/containers/Bundle/Application/7EF5BCB5-4C9C-4CCA-86E8-C9B3332E7BE4/Roobinet.app/Frameworks/HaishinKit_-79AB4CDABF03AA0A_PackageProduct.framework/HaishinKit_-79AB4CDABF03AA0A_PackageProduct' (no such file)
Posted
by AlSafari.
Last updated
.
Post not yet marked as solved
2 Replies
341 Views
We have one custom library/framework with ARCHS = $(ARCHS_STANDARD) under build settings. I export the library/framework with "Any iOS device" target and export the library/framework. But when we try to integrate this custom library/framework in to another project ( M1 with xcode 14.2 with rosetta enabled ) its not running in iOS simulator. Getting error like. : Unsupported Swift architecture Note : Its running fine in real device.
Posted Last updated
.
Post not yet marked as solved
2 Replies
298 Views
I'm trying to build a dynamic version of an old C static library. The static library, as it stands, references symbols which are defined in the program the static library is bound to. When I try to build this as a dynamic library I get: ld: symbol(s) not found for architecture x86_64 messages. I suspect there is a way to work around this (weak references?) but I don't understand how to do it, and none of the online documentation and commentary I have found seems to help. Does anyone have suggestions to offer?
Posted
by rmfritz.
Last updated
.
Post not yet marked as solved
1 Replies
270 Views
I'm using the official Dropbox Objective C framework within an Xcode Objective C iOS project. If I clean and rebuild the project, I have no problems running the app. If I then rebuild and run, I get a linker error: dyld[12193]: Symbol not found: _OBJC_CLASS_$_DBScopeRequest Referenced from: <A3ABDE7A-6441-3771-9061-F2CC46FEEBF3> /private/var/containers/Bundle/Application/30EC2350-4AE3-4194-9F0C-B5087FEDB042/AppName.app/AppName Expected in: <163AA2D6-A97B-396E-8300-E44FA89645D8> /private/var/containers/Bundle/Application/30EC2350-4AE3-4194-9F0C-B5087FEDB042/AppName.app/Frameworks/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial I can then clean and build and run again successfully. So it sort of works, but having to clean and build every single time is very inefficient. It doesn't seem to be a problem inherent to the Dropbox framework. I've tried the usual debugging steps such as deleting the derived data folder, restarting Xcode, etc.
Posted Last updated
.
Post not yet marked as solved
2 Replies
276 Views
swift_getFunctionReplacement, referenced from: _swift_getFunctionReplacement50 in libswiftCompatibilityDynamicReplacements.a[x86_64][6](DynamicReplaceable.cpp.o) _swift_getFunctionReplacement50 in libswiftCompatibilityDynamicReplacements.a[x86_64][6](DynamicReplaceable.cpp.o) _swift_getOrigOfReplaceable, referenced from: _swift_getOrigOfReplaceable50 in libswiftCompatibilityDynamicReplacements.a[x86_64][6](DynamicReplaceable.cpp.o) _swift_getOrigOfReplaceable50 in libswiftCompatibilityDynamicReplacements.a[x86_64][6](DynamicReplaceable.cpp.o) clang: error: linker command failed with exit code 1 (use -v to see invocation)
Posted Last updated
.
Post not yet marked as solved
3 Replies
405 Views
Im having difficulty trying to find C references for the functions and their inputs for the frameworks inside of /System/Library/Frameworks/. Whenever I search it up online I can only get documentation for usage in Swift and Obj-C. I'm trying to link to Carbon.framework in C++ but I can't seem to find any references for the actual funtions I can use. This seems to be across all of the frameworks and the closest I found to a source of refrences was the documentation archive but none of it seems to show the actual references. If anyone has a link to any sort of refrences of any kind then please link them 🥰
Posted
by Garfunkle.
Last updated
.
Post not yet marked as solved
1 Replies
468 Views
I have tried to build the Rust Compiler using XCode 15 and ld. So, I got the linker errors. ld: warning: ignoring file '/private/var/folders/q4/3s60g5510ydbd3qc3p4xflm80000gn/T/rustcms1l5o/symbols.o': found architecture 'arm64e.old', required architecture 'arm64e' My env is Darwin Mac-1702981776371.local 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:39:52 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_X86_64 x86_64 Xcode 15.0.1 Build version 15A507 Apple clang version 15.0.0 (clang-1500.0.40.1) Target: x86_64-apple-darwin22.6.0 Thread model: posix InstalledDir: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin @(#)PROGRAM:ld PROJECT:dyld-1015.7 BUILD 16:59:22 Oct 1 2023 configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em will use ld-classic for: armv6 armv7 armv7s arm64_32 i386 armv6m armv7k armv7m armv7em LTO support using: LLVM version 15.0.0 (static support for 29, runtime is 29) TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.0.12.3) Library search paths: Framework search paths: Moreover, I cannot reproduce it using Xcode 14.3.1. I don't have any errors when I use LLVM lld. Xcode 14.3.1 Build version 14E300c /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk I tried to compare private headers for binaries using otool -h. They are the same. How can I fix it?
Posted
by arttet.
Last updated
.
Post not yet marked as solved
2 Replies
365 Views
I'm trying to run an app that has a .dylib listed in the configuration of the application as "Embed &amp; Sign" I can confirm it is correctly signed by inspecting the package using codesign -dv --verbose=4 lib_paths.dylib and it gives me the following: Executable=/Users/blablabla/Debug-iphoneos/TestApp.app/Frameworks/lib_paths.dylib Identifier=lib_paths Format=Mach-O thin (arm64) CodeDirectory v=20400 size=784 flags=0x0(none) hashes=16+5 location=embedded VersionPlatform=2 VersionMin=917504 VersionSDK=1049600 Hash type=sha256 size=32 CandidateCDHash sha256=7eaecbb8e00114767c9de0ac9054213620052212 CandidateCDHashFull sha256=7eaecbb8e00114767c9de0ac90542136200522121105dd217b38bd27e1fda4de Hash choices=sha256 CMSDigest=7eaecbb8e00114767c9de0ac90542136200522121105dd217b38bd27e1fda4de CMSDigestType=2 Executable Segment base=0 Executable Segment limit=32768 Executable Segment flags=0x0 Page size=4096 Launch Constraints: None CDHash=7eaecbb8e00114767c9de0ac9054213620052212 Signature size=4795 Authority=Apple Development: myemail@address.com (XXXXXXXXX) Authority=Apple Worldwide Developer Relations Certification Authority Authority=Apple Root CA Signed Time=13 Dec 2023 at 21:39:28 Info.plist=not bound TeamIdentifier=XXXXXXXXXXX Sealed Resources=none Internal requirements count=1 size=180 But when trying to run the application, I am getting the following error: Referenced from: '/private/var/containers/Bundle/Application/3142F1F2-547B-41B5-8EF4-239F4EAD2A4F/TestApp.app/FSVTestApp' Reason: tried: '/usr/lib/system/introspection/lib_paths.dylib' (no such file), '/usr/lib/swift/lib_paths.dylib' (no such file), '/private/var/containers/Bundle/Application/3142F1F2-547B-41B5-8EF4-239F4EAD2A4F/TestApp.app/Frameworks/lib_paths.dylib' (code signature invalid (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0000C5E0, codeBlobSize=0x00004B50 for '/private/var/containers/Bundle/Application/3142F1F2-547B-41B5-8EF4-239F4EAD2A4F/TestApp.app/Frameworks/lib_paths.dylib'), Note that I enabled the "Automatically manage signing" option, and using a Personal Team. This seems to work fine for the application itself (otherwise it wouldnt even try to load the dylib). What is going on ?
Posted Last updated
.
Post not yet marked as solved
2 Replies
426 Views
xcode :Version 15.0.1 (15A507) MACOS:13.6.1 (22G313) thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x0000000000000000 frame #1: 0x000000010482ec60 FUSTAKitOUTLINED_FUNCTION_3 + 580 frame #2: 0x0000000104430810 dyldImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 424 frame #3: 0x0000000104430bd8 dyldImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 52 frame #4: 0x000000010442b600 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 536 frame #5: 0x000000010442b56c dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 388 frame #6: 0x0000000104429878 dyldImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 184 frame #7: 0x0000000104429940 dyldImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 92 frame #8: 0x000000010441a6d8 dylddyld::initializeMainExecutable() + 216 frame #9: 0x000000010441f928 dylddyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 5216 frame #10: 0x0000000104419208 dylddyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 396 frame #11: 0x0000000104419038 dyld`_dyld_start + 56 when I run a Test app(Just create with xcode Version 15.0.1 (15A507),without any extra code) depency FUSTAKit.framework packed by xcode Version 15.0.1 (15A507), i find this error。 but used xcode 14.2 pack FUSTA Kit.framework , everything is normal 。
Posted Last updated
.
Post not yet marked as solved
1 Replies
394 Views
I am trying to add an Apple Watch companion app to my iPhone app. I have no experience with Apple Watch at all, so I followed the Apple instructions as described on https://developer.apple.com/tutorials/swiftui/creating-a-watchos-app I followed that instruction to the letter, and did not add anything to it, and now have two targets in the project: the original iPhone target, and the Apple Watch target. When I try to build the Watch app, I get the following linker error: error: Build input file cannot be found: '/usr/lib/libobjc.A.dylib'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? The linker command has the following argument on it: -weak_library /usr/lib/libobjc.A.dylib The "Link binary with libraries" option of the "Build Phases" of the Apple Watch target does not have any libraries specified. Does anybody know what the libobjc library is, and what it is used for? Where is this linker flag configured? How can I make this work? EDIT: The -weak_library /usr/lib/libobjc.A.dylib is configured in the Project Build Settings, "Other Linker Flags". It seems to be a basic necessity that was already there before I added the Watch target. When I remove it, I get "Undefined symbol: _main" errors. So it seems to be something fundamental that is required. The question is now why it is not found by the linker. If it matters, the iPhone app has always been Objective-C, but I'd like to start with Swift for the Apple Watch app, so have chosen to create that as a Swift app.
Posted
by baraupp.
Last updated
.
Post marked as solved
2 Replies
609 Views
Hello, Upgrading to Xcode 15 and building for testing ends up with errors. Note: Xcode 15.1 beta3 & 15.0.1 - normal debug build works Xcode 15.1 beta3 & 15.0.1 - unit test build fails Xcode 14.3.1 - both builds work Using Swift Package Manager to add the packages Error: ld: Undefined symbols: (extension in PackageX):...-> SwiftUI.Font, referenced from: PackageY... in PackageY.o (extension in PackageX)... ... clang: error: linker command failed with exit code 1 (use -v to see invocation) What I've tried: clean up project remove & add involved packages adding 'other linker flags' to the main target build settings such as -ld64, -ld_classic What should I update to work in Xcode 15? Thank you.
Posted
by polikw.
Last updated
.
Post not yet marked as solved
1 Replies
381 Views
Hello team, We have some time experiencing this crash in our application, this only happens on iOS 13.x versions, and it's working perfectly on iOS 12.x, iOS 14.x and upper. To compile the application we are using Xcode 14.2.0, but I read in other threads that the issue should be fixed by using Xcode 14.3.1: https://developer.apple.com/forums/thread/727680?answerId=753414022#753414022 So I tested again by compiling the app with that version but the result is the same, the app crashes immediately. I have also tried to compile it with Xcode 15.x but with no results. This is the crash log: {"app_name":"Retail-Beta","timestamp":"2023-11-20 22:25:22.00 +0000","app_version":"1.29.0","slice_uuid":"fe183a9d-16be-355d-b7dc-61ec3ddc8537","adam_id":0,"build_version":"1","bundleID":"com.inditex.appgeret.dev","share_with_app_devs":0,"is_first_party":0,"bug_type":"109","os_version":"iPhone OS 13.4.1 (17E8258)","incident_id":"791A392C-B9FB-44A1-98FF-C7361A37AFC6","name":"Retail-Beta"} Incident Identifier: 791A392C-B9FB-44A1-98FF-C7361A37AFC6 CrashReporter Key: 6af5c2f0a1a67986c7759373f00ff1e4c8cc596b Hardware Model: iPhone12,8 Process: Retail-Beta [1680] Path: /private/var/containers/Bundle/Application/82DCA6DB-3F0D-4230-8011-5CF9CE678B4B/Retail-Beta.app/Retail-Beta Identifier: com.....appgeret.dev Version: 1 (1.29.0) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.....appgeret.dev [1827] Date/Time: 2023-11-20 22:25:22.1498 +0000 Launch Time: 2023-11-20 22:25:21.8010 +0000 OS Version: iPhone OS 13.4.1 (17E8258) Release Type: User Baseband Version: 1.05.28 Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Description: DYLD, Assertion failed: (gotLocation), function applyFixupsToImage_block_invoke_3, file /Library/Caches/com.apple.xbs/Sources/dyld/dyld-750.4.2/dyld3/Loading.cpp, line 779. Highlighted by Thread: 0 Backtrace not available Unknown thread crashed with ARM Thread State (64-bit): x0: 0x0000000000000006 x1: 0x0000000000000009 x2: 0x000000016d8b41a0 x3: 0x0000000000000014 x4: 0x000000016d8b3da0 x5: 0x0000000000000000 x6: 0x000000016d8b4b30 x7: 0x000000016d8b4c48 x8: 0x0000000000000020 x9: 0x0000000000000009 x10: 0x2e676e6964616f4c x11: 0x6e696c202c707063 x12: 0x2f33646c79642f32 x13: 0x2e676e6964616f4c x14: 0x6e696c202c707063 x15: 0x000a2e3937372065 x16: 0x0000000000000209 x17: 0x000000010349f510 x18: 0x0000000000000000 x19: 0x0000000000000000 x20: 0x000000016d8b3da0 x21: 0x0000000000000014 x22: 0x000000016d8b41a0 x23: 0x0000000000000009 x24: 0x0000000000000006 x25: 0x0000000000000160 x26: 0x000000000000035e x27: 0x000000010333a62c x28: 0x00000000000e69b0 fp: 0x000000016d8b3d70 lr: 0x00000001034ac66c sp: 0x000000016d8b3d30 pc: 0x00000001034a4f30 cpsr: 0x40000000 esr: 0x00000000 Address size fault Binary images description not available Error Formulating Crash Report: Failed to create CSSymbolicatorRef - corpse still valid ¯\_(ツ)_/¯ EOF Could you please help us to understand what it's happening here? Are we missing something or could we are doing something wrong from our side? We are running low on options or ideas. Thanks in advance, Paul
Posted Last updated
.