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

Posts under Linker tag

160 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

dyld[ ]: Library not loaded:
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)
1
0
850
Jan ’24
Custom library/framework with ARCHS = $(ARCHS_STANDARD) not running in iOS simulator
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.
2
0
484
Jan ’24
Converting an old C library from static to dynamic
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?
2
0
358
Jan ’24
Symbol not found linker error unless project is cleaned first
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.
1
0
333
Jan ’24
build swift and oc dylib link issues
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)
2
0
329
Jan ’24
Are there any macOS framework references for C?
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 🥰
3
0
468
Jan ’24
ld: warning: found architecture 'arm64e.old', required architecture 'arm64e'
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?
1
0
592
Jan ’24
Unable to load embedded and signed dylib on iPhone
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 ?
2
0
448
Dec ’23
xcode 15 dyld 报错
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 。
2
0
609
Dec ’23
Apple Watch app: libobjc.A.dylib not found
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.
1
0
509
Dec ’23
Xcode 15 - Swift Package Manager - undefined symbols
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.
2
1
808
Nov ’23
Runtime Crash on iOS 13.x - Loading.cpp : applyFixupsToImage
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
2
1
515
Nov ’23
Xcode doesn't link my 3rd party dylibs post build
I'm developing a cross plaform application and am using Xcode to build the MacOS executable. I have it building and running on my machine with the 3rd party dynamic libraries placed in /opt/homebrew (as installed by brew), but obviously when I move to another machine it doesn't work Within Xcode i've added my 3rd party dependencies to Frameworks, Libraries and Embedded content within my target. After the build, these are copied to Contents/Frameworks as I expect but the executable is not linked to these dylibs but the ones in /opt/homebrew I read around the forums here and set dynamic library install name = @rpath/$(EXECUTABLE_PATH) and runpath search path = @executable_path/../Frameworks but this doesn't fix my issue While I'm confident working with other platforms, this is my first time developing for MacOS, I've only been a Mac user for ten months so i know this is an easy fix its just something I'm missing
1
0
473
Nov ’23
SwiftUI App - Archive and Distribute Processing
I wanna test my SwiftUI app on TestFlight and then I'll release the app on App Store. However, I get an error during Distribute App processing. I do Archive and Distribute App with TestFlight &amp; App Store option and then I get "Assert Validation Failed" see below. When I check output of compiling, I see a few warnings. You can see below. I totally do not understand what problem is. How can I solve this problem ?
0
0
429
Nov ’23
Expected in: /usr/lib/libc++.1.dylib
dyld: Symbol not found: __ZTTNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE Referenced from: /private/var/containers/Bundle/Application/19315D00-BA14-46B0-83BD-0961BBFFC9B8/VBell.app/VBell Expected in: /usr/lib/libc++.1.dylib in /private/var/containers/Bundle/Application/19315D00-BA14-46B0-83BD-0961BBFFC9B8/VBell.app/VBell Who knows how to solve this problem?
2
0
1.3k
Nov ’23
helper app dyld crash when using Xcode debugger
When I'm running my Mac app in the Xcode debugger, and it launches a helper app, the helper crashes with a dyld error. This does not happen if I am not debugging. Termination Reason: Namespace DYLD, Code 1 Library missing Library not loaded: @rpath/Cal3D.framework/Versions/A/Cal3D Referenced from: <3C1A67BA-5545-31A2-86C5-77104B0194FE> /Volumes/VOLUME/*/SBEngineLib4.framework/Versions/A/SBEngineLib4 The frameworks SBEngineLib4.framework and Cal3D.framework exist in the main app. The helper app does not contain any frameworks, but does contain dylib versions of those frameworks, which I suppose is confusing things somehow.
8
0
660
Nov ’23
tapi generates .tbd lacking expected UUIDs
I'm trying to use tapi to generate a .tbd for a multi-arch dynamic library. The dynamic library has LC_UUIDs for both architectures, but the generated .tbd does not have a uuids section. I have tried generating .tbd versions 2, 3, and 4. (Which version should I use if I want to support older macOS releases?) I'm using the command tools from Xcode 15.0.1 on macOS 14.1 on arm64.
5
0
530
Nov ’23
Unable to resolve dynamically linked SPM target in Xcode 15
Hello all, we have ran into a problem building our test target that only occurs in Xcode 15. Our team has an SPM package that we use for shared code across our apps. This SPM package also has a dynamically linked target that contains utilities for testing. Within our app we link this test utilities library via Build Phases -> Link Binary with Libraries. On Xcode < 15 we have no problem resolving this library within our test target but on 15 we get a linking error if we try and and link it in the same way. If we remove this library from Build Phases -> Link Binary with Libraries then the linking error goes away, though of course then we will get errors as this library is still used within the XCTests of our test target. This is a simplified snippet of what our Package.swift looks like for our Swift Package let package = Package( name: "Library", platforms: [ .iOS(.v15) ], products: [ .library( name: "Library", targets: ["Library"] ), .library( name: "LibraryTestUtilities", type: .dynamic, targets: ["LibraryTestUtilities"] ) ], dependencies: [ // Dependencies declare other packages that this package depends on. ], targets: [ .target( name: "Library", dependencies: [ // Dependencies ]) , .target( name: "LibraryTestUtilities", dependencies: [ "Library" ]), .testTarget( name: "LibraryTests", dependencies: ["Library", "LibraryTestUtilities"]), ] ) I have tried to use the linker flags -ld_classic and -ld64 to no avail and I'm not sure where to go from here. It's not exactly obvious what linking change in Xcode 15 is resulting in the failure to resolve this library. We would appreciate any help on this matter, thanks!
1
1
894
Nov ’23
Can the Xcode linker deduplicate symbols in a merged binary?
Intro I'm trying to determine whether Xcode's new Mergeable Libraries feature can remove duplicated symbols in a scenario where an app links to two dynamic frameworks which both link to the same static library, as follows: |--App |--DynamicFramework1 |--StaticLibrary |--DynamicFramework2 |--StaticLibrary <- the same library that DynamicFramework1 links to Project setup Here are some details about the app's structure: The static library is named StaticLibrary. It: Contains a single Objective-C class named SLClass1 The first dynamic framework target is named DynamicFramework1. It: Contains a single Objective-C class named DF1Class1 that calls into SLClass1; and Has a MERGEABLE_LIBRARY build setting value of YES. The second dynamic framework target is named DynamicFramework2. It: Contains a single Objective-C class named DF2Class1 that calls into SLClass1; and Has a MERGEABLE_LIBRARY build setting value of YES. The app target is named App. It: Contains a single Swift class named ViewController that calls into the DF1Class1 and DF2Class1 classes; and Has a MERGED_BINARY_TYPE build setting value of Automatic. (1) I've created a minimal Xcode project here that has the above structure. Expected result The merged app binary, when built it in Release mode, contains the symbols for DF1Class1, DF2Class1 and SLClass1 directly within it and it contains only one instance of each of these symbols (i.e. no duplicates). I am basing this expectation on the Benefits of mergeable libraries section of the Meet mergeable libraries talk from WWDC 2023 where the speaker said: When merging, the linker can de-duplicate content, such as strings, across all libraries. For instance, it removes redundant symbol references, Objective-C selectors, and objc_msgsend stubs. Actual result The merged app binary, when built it in Release mode, contains the symbols for DF1Class1, DF2Class1 and SLClass1 directly within it but it contains two instances of SLClass1's symbols (i.e. it contains duplicates). (2) My Question Have I missed something in the app's build settings or have I misunderstood the capability of Mergeable Libraries? Can I get the Xcode linker to deduplicate symbols in the app's merged binary? Footnotes I have tried with a MERGED_BINARY_TYPE build setting value of Manual also but the result is the same. I have validated this by running the nm command on the app's executable file and inspecting the output.
1
0
552
Nov ’23