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

165 Posts
Sort by:
Post not yet marked as solved
3 Replies
306 Views
Recently Apple deprecated the NXFindBestFatArch, used to find the most compatible / appropriate slice in a universal/fat binary. However its replacement macho_best_slice is broken and will return EBADARCH for any non-Apple binary 😓 The issue seems to be that the dyld3::GradedArchs::grade method does not take into the account the nuances of the CPU sub types of type *_ALL. Namely that any CPU with a more specific sub type (e.g. CPU_SUBTYPE_ARM64E) can also still execute code compiled with a CPU sub type of *_ALL (e.g. CPU_SUBTYPE_ARM64_ALL). All the details (+code, +debugging, +disassembly) posted at: https://objective-see.org/blog/blog_0x80.html. Also, hrmm!?:
Posted Last updated
.
Post not yet marked as solved
0 Replies
262 Views
I am recently migrated from android to Apple Store. Trying to publish my first Unity Game but this error pop up. Would be great if anyone could help. I think this bug belongs to Admob on Unity Game. Showing All Messages Undefined symbol: OBJC_CLASS$_GAMRequest Undefined symbol: _objc_msgSend$setCustomTargeting: Undefined symbol: _objc_msgSend$categoryExclusions Undefined symbol: OBJC_CLASS$_GAMInterstitialAd Undefined symbol: _objc_msgSend$interstitialAdGAM Undefined symbol: OBJC_CLASS$_GADRewardedInterstitialAd Undefined symbol: _objc_msgSend$setRewardedInterstitialAd: Undefined symbol: _objc_msgSend$didEarnRewardCallback Undefined symbol: _objc_msgSend$presentFromRootViewController:userDidEarnRewardHandler: Undefined symbol: _objc_msgSend$setRewardedAd: Undefined symbol: OBJC_CLASS$_GADRequest Undefined symbol: _objc_msgSend$setKeywords: Undefined symbol: _objc_msgSend$requestAgent Undefined symbol: _objc_msgSend$registerAdNetworkExtras: Undefined symbol: _objc_msgSend$extras Undefined symbol: _objc_msgSend$stringWithFormat: Undefined symbol: _objc_msgSend$objectForKey: Undefined symbol: OBJC_CLASS$_GADInterstitialAd Undefined symbol: _objc_msgSend$interstitialAd Undefined symbol: _objc_msgSend$loadWithAdUnitID:request:completionHandler: Undefined symbol: OBJC_CLASS$_UMPDebugSettings Undefined symbol: OBJC_CLASS$_UMPRequestParameters Undefined symbol: _objc_msgSend$debugSettings Undefined symbol: OBJC_CLASS$_UMPConsentInformation Undefined symbol: OBJC_CLASS$_GADExtras Undefined symbol: _objc_msgSend$countByEnumeratingWithState:objects:count: Undefined symbol: _objc_msgSend$presentFromViewController:completionHandler: Undefined symbol: _objc_msgSend$loadWithCompletionHandler: Undefined symbol: _objc_msgSend$adClickedCallback Undefined symbol: _objc_msgSend$adFailedCallback Undefined symbol: _objc_msgSend$description Undefined symbol: _objc_msgSend$currencyCode Undefined symbol: _objc_msgSend$customAdPosition Undefined symbol: _kGADAdSizeSmartBannerPortrait Undefined symbol: _objc_msgSend$frame Undefined symbol: _objc_msgSend$bannerView Undefined symbol: _objc_msgSend$bannerClient Undefined symbol: _objc_msgSend$adaptiveAdSizeForWidth:orientation: Undefined symbol: _objc_msgSend$adSizeForWidth:height: Undefined symbol: _objc_msgSend$interstitialClient Undefined symbol: _objc_msgSend$initWithBannerClientReference:adUnitID:adSize:adPosition: Undefined symbol: _objc_msgSend$setAppEventDelegate: Undefined symbol: _objc_msgSend$adWillPresentFullScreenContentCallback Undefined symbol: _objc_msgSend$adDidDismissFullScreenContentCallback Undefined symbol: _objc_msgSend$setAdFailedToLoadCallback: Undefined symbol: _objc_msgSend$presentFromRootViewController: Undefined symbol: _objc_msgSend$adFailedToPresentFullScreenContentCallback Undefined symbol: _objc_msgSend$adFailedToLoadCallback Undefined symbol: _objc_msgSend$paidEventCallback Undefined symbol: _objc_msgSend$allKeys Undefined symbol: OBJC_CLASS$_GADAppOpenAd Undefined symbol: _objc_msgSend$cStringUsingEncoding: Undefined symbol: _objc_msgSend$setAppOpenAd: Undefined symbol: _objc_msgSend$setInterstitialAdGAM: Undefined symbol: _objc_msgSend$request Undefined symbol: _objc_msgSend$setFullScreenContentDelegate: Undefined symbol: _objc_msgSend$adReceivedCallback Undefined symbol: _objc_msgSend$testDeviceIdentifiers Undefined symbol: _objc_msgSend$appOpenAd Undefined symbol: _objc_msgSend$setPaidEventHandler: Undefined symbol: _objc_msgSend$setDelegate: Undefined symbol: _objc_msgSend$appOpenAdClient Undefined symbol: _objc_msgSend$rewardedInterstitialAdClient Undefined symbol: _objc_msgSend$didDismissCallback Undefined symbol: _objc_msgSend$loadWithAdUnitID:request:orientation:completionHandler: Undefined symbol: OBJC_CLASS$_GADBannerView Undefined symbol: _GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth Undefined symbol: _GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth Undefined symbol: _objc_msgSend$show Undefined symbol: _objc_msgSend$adDidRecordImpressionCallback Undefined symbol: _objc_msgSend$window Undefined symbol: _GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth Undefined symbol: _objc_msgSend$setCustomTargetingWithKey:value: Undefined symbol: _GADAdSizeFullWidthPortraitWithHeight Undefined symbol: _objc_msgSend$positionView:inParentView:customPosition: Undefined symbol: _objc_msgSend$setCenter: Undefined symbol: _kGADAdSizeSmartBannerLandscape Undefined symbol: _GADAdSizeEqualToSize Undefined symbol: _CGSizeFromGADAdSize Undefined symbol: _objc_msgSend$isOperatingSystemAtLeastVersion: Undefined symbol: _objc_msgSend$safeAreaLayoutGuide Undefined symbol: _objc_msgSend$positionBannerView Undefined symbol: _objc_msgSend$loadFormWithCompletionHandler: Undefined symbol: _objc_msgSend$initWithConsentFormClientReference: Undefined symbol: _objc_msgSend$setObject:forKey: Undefined symbol: _objc_msgSend$willPresentCallback Undefined symbol: _objc_msgSend$reset Undefined symbol: _objc_msgSend$isConsentFormAvailable Undefined symbol: _objc_msgSend$requestConsentInfoUpdateWithParameters:completionHandler: Undefined symbol: _objc_msgSend$setDebugSettings: Undefined symbol: _objc_msgSend$adReward Undefined symbol: _GADAdSizeFromCGSize Undefined symbol: OBJC_CLASS$_GADServerSideVerificationOptions Undefined symbol: _objc_msgSend$code Undefined symbol: OBJC_CLASS$_GADMobileAds Undefined symbol: _objc_msgSend$adUnitMapping Undefined symbol: _objc_msgSend$adSourceID Undefined symbol: _objc_msgSend$value Undefined symbol: _GADErrorUserInfoKeyResponseInfo Undefined symbol: _objc_msgSend$localizedDescription
Posted Last updated
.
Post not yet marked as solved
0 Replies
349 Views
I have an Xcode project with an obj-c .c file and a .h file aswell as a .swift file where I am calling functions from those obj-c files with a bridging header but when I build my project I get a duplicate symbols error and Xcode doesn't show where. here is .h header file: #define smc_h #include <stdint.h> #include <mach/mach.h> #include <IOKit/IOKitLib.h> typedef struct { uint32_t datasize; uint32_t datatype; uint8_t data[8]; } SMCVal_t; io_connect_t conn; kern_return_t openSMC(void); kern_return_t closeSMC(void); kern_return_t readSMC(char *key, SMCVal_t *val); double convertToFahrenheit(SMCVal_t *val); #endif /* smc_h */ my .c implementation file: #include "smc.h" kern_return_t openSMC(void) { kern_return_t result; kern_return_t service; io_iterator_t iterator; service = IOServiceGetMatchingServices(kIOMainPortDefault, IOServiceMatching("AppleSMC"), &iterator); if(service == 0) { printf("error: could not match dictionary"); return 0; } result = IOServiceOpen(service, mach_task_self(), 0, &conn); IOObjectRelease(service); return 0; } kern_return_t closeSMC(void) { return IOServiceClose(conn); } kern_return_t readSMC(char *key, SMCVal_t *val) { kern_return_t result; uint32_t keyCode = *(uint32_t *)key; SMCVal_t inputStruct; SMCVal_t outputStruct; inputStruct.datasize = sizeof(SMCVal_t); inputStruct.datatype = 'I' << 24; //a left shift operation. turning the I into an int by shifting the ASCII value 24 bits to the left inputStruct.data[0] = keyCode; result = IOConnectCallStructMethod(conn, 5, &inputStruct, sizeof(SMCVal_t), &outputStruct, (size_t*)&inputStruct.datasize); if (result == kIOReturnSuccess) { if (val -> datasize > 0) { if (val -> datatype == ('f' << 24 | 'l' << 16 | 't' << 8 )) { //bit shifting to from 32bit operation associated with the ASCII charecters'f', 'l', and 't', sets datatype field. double temp = *(double *)val -> data; return temp; } } } return 0.0; } double convertToFahrenheit(SMCVal_t *val) { if(val -> datatype == ('f' << 24 | 'l' << 16 | 't' << 8 )) { //checking if val->datatype is equal to the result of the bit-shifting operation. double temp = *(double *)val -> data; return (temp * 9.0 / 5.0) + 32.0; } return 0.0; } And my .swift file where my objc functions are called: import IOKit public class CPUTempCaller { public struct SMCVal_t { var datasize: UInt32 var datatype: UInt32 var data: (UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8) } @_silgen_name("openSMC") func openSMC() -> Int32 @_silgen_name("closeSMC") func closeSMC() -> Int32 @_silgen_name("readSMC") func readSMC(key: UnsafePointer<CChar>?,val: UnsafeMutablePointer<SMCVal_t>) -> kern_return_t @_silgen_name("convertToFahrenheit") func convertToFahrenheit(val: UnsafePointer<SMCVal_t>) -> Double { let openSM = openSMC() guard openSM == 0 else { print("Failed to open SMC: \(openSM)") return 0.0; } let closeSM = closeSMC() guard closeSM == 0 else { print("could not close SMC: \(closeSM)") return 0.0; } func convertAndPrintTempValue(key:UnsafePointer<CChar>?,scale: Character, showTemp: Bool ) -> Double? { var SMCValue = SMCVal_t(datasize: 0, datatype: 0, data:(0,0,0,0,0,0,0,0)) //initializing SMC value if let Key = key { //check if nil. If not nil, proceed to code block execution let key = "TC0P" let keyCString = (key as NSString).utf8String //passing key as null terminated utf8 string let readSMCResult = readSMC(key: keyCString, val: &SMCValue) //call readSMC obj-C function, store result in "readSMCResult" if readSMCResult != KERN_SUCCESS { print("Failed to read SMC: \(readSMCResult)") } } if showTemp { //return nil if showTemp is false let convertRawToFahrenheit = convertToFahrenheit(val: &SMCValue) let scaleToStr = String(scale) print(String(format: "Temperature: %0.1f °%c", convertRawToFahrenheit, scaleToStr)) return nil } else { print("could not convert temperature and format values in Fahrenheit") return nil } } return 0.0; } }
Posted
by Aor1105.
Last updated
.
Post marked as solved
3 Replies
692 Views
Hello, while my project, which I created with the Unity game engine, runs smoothly in the editor, when I try to run it and/or archive through Xcode, I receive the following error: Undefined symbols: Linker command failed with exit code 1 (use -v to see invocation) When I right click on the problem and click Reveal in log it doesn't take me anywhere. Can you help me with this? Thanks.
Posted
by hbdnr.
Last updated
.
Post not yet marked as solved
1 Replies
522 Views
I have an Xcode project that include a .c file and .h header file. I am getting a duplicate symbol error and I cannot pinpoint what part of my code is the issue or maybe if it's a configuration issue in my Xcode settings or not. Here's my .h header file code with my declarations: #define smc_h #include <stdint.h> #include <mach/mach.h> #include <IOKit/IOKitLib.h> typedef struct { uint32_t datasize; uint32_t datatype; uint8_t data[8]; } SMCVal_t; extern io_connect_t conn; kern_return_t openSMC(void); kern_return_t closeSMC(void); kern_return_t readSMC(char *key, SMCVal_t *val); double convertToFahrenheit(SMCVal_t *val); #endif /* smc_h */ And here is my .c implementation: #include "smc.h" #include <mach/mach.h> #include <IOKit/IOKitLib.h> io_connect_t conn; kern_return_t openSMC(void) { kern_return_t result; kern_return_t service; io_iterator_t iterator; service = IOServiceGetMatchingServices(kIOMainPortDefault, IOServiceMatching("AppleSMC"), &iterator); if(service == 0) { printf("error: could not match dictionary"); return 0; } result = IOServiceOpen(service, mach_task_self(), 0, &conn); IOObjectRelease(service); return 0; } kern_return_t closeSMC(void) { return IOServiceClose(conn); } kern_return_t readSMC(char *key, SMCVal_t *val) { kern_return_t result; uint32_t keyCode = *(uint32_t *)key; SMCVal_t inputStruct; SMCVal_t outputStruct; inputStruct.datasize = sizeof(SMCVal_t); inputStruct.datatype = 'I' << 24; //a left shift operation. turning the I into an int by shifting the ASCII value 24 bits to the left inputStruct.data[0] = keyCode; result = IOConnectCallStructMethod(conn, 5, &inputStruct, sizeof(SMCVal_t), &outputStruct, (size_t*)&inputStruct.datasize); if (result == kIOReturnSuccess) { if (val -> datasize > 0) { if (val -> datatype == ('f' << 24 | 'l' << 16 | 't' << 8 )) { //bit shifting to from 32bit operation associated with the ASCII charecters'f', 'l', and 't', sets datatype field. double temp = *(double *)val -> data; return temp; } } } return 0.0; } double convertToFahrenheit(SMCVal_t *val) { if(val -> datatype == ('f' << 24 | 'l' << 16 | 't' << 8 )) { //checking if val->datatype is equal to the result of the bit-shifting operation. double temp = *(double *)val -> data; return (temp * 9.0 / 5.0) + 32.0; } return 0.0; }
Posted
by Aor1105.
Last updated
.
Post not yet marked as solved
1 Replies
501 Views
I am now using the fortran compiler to compile the codes with the command of "make -f Makefile". In the previous time, the command: make -f Makefile works well, but after updating the MacOS system, the same command results in the following error: -macosx_version_min has been renamed to -macos_version_min ld: unknown options: -commons collect2: error:ld returns 1 Is there anyone know how to solve the above problem? Thanks a lot for your time and help.
Posted
by myfeng.
Last updated
.
Post not yet marked as solved
1 Replies
345 Views
Hello, I have been experiencing the problem you see below for a long time. How can I solve it? As a result of my research, I tried many things but it didn't work. Cocoapods is used in the project. Can you help me? dyld[71940]: Library not loaded: @rpath/Papara.framework/Papara Referenced from: &lt;9ADE446C-A9F6-30B8-A6AB-FFB2B4D3F9C4&gt; /Users/mehmet.akyol/Library/Developer/CoreSimulator/Devices/E2C4776D-41A3-4C52-B2CB-B6BB80CD4B3F/data/Containers/Bundle/Application/3B8E2E48-FD91-453F-9211-1FC4193ACB51/iosTurknet.app/iosTurknet Reason: tried: '/Users/mehmet.akyol/Library/Developer/Xcode/DerivedData/iosTurknet-cuvkzreipstianayawphjkqjginw/Build/Products/Debug-iphonesimulator/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/Xcode/DerivedData/iosTurknet-cuvkzreipstianayawphjkqjginw/Build/Products/Debug-iphonesimulator/PackageFrameworks/Papara.framework/Papara' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/Papara.framework/Papara' (no such file), '/usr/lib/swift/Papara.framework/Papara' (no such file, no dyld cache), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/Users/mehmet.akyol/Library/Developer/Xcode/DerivedData/iosTurknet-cuvkzreipstianayawphjkqjginw/Build/Products/Debug-iphonesimulator/PackageFrameworks/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/Xcode/DerivedData/iosTurknet-cuvkzreipstianayawphjkqjginw/Build/Products/Debug-iphonesimulator/PackageFrameworks/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/CoreSimulator/Devices/E2C4776D-41A3-4C52-B2CB-B6BB80CD4B3F/data/Containers/Bundle/Application/3B8E2E48-FD91-453F-9211-1FC4193ACB51/iosTurknet.app/Frameworks/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/CoreSimulator/Devices/E2C4776D-41A3-4C52-B2CB-B6BB80CD4B3F/data/Containers/Bundle/Application/3B8E2E48-FD91-453F-9211-1FC4193ACB51/iosTurknet.app/Frameworks/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/CoreSimulator/Devices/E2C4776D-41A3-4C52-B2CB-B6BB80CD4B3F/data/Containers/Bundle/Application/3B8E2E48-FD91-453F-9211-1FC4193ACB51/iosTurknet.app/Papara.framework/Papara' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/Papara.framework/Papara' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/Papara.framework/Papara' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/Papara.framework/Papara' (no such file), '/usr/lib/swift/Papara.framework/Papara' (no such file, no dyld cache), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/Users/mehmet.akyol/Library/Developer/Xcode/DerivedData/iosTurknet-cuvkzreipstianayawphjkqjginw/Build/Products/Debug-iphonesimulator/PackageFrameworks/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/Xcode/DerivedData/iosTurknet-cuvkzreipstianayawphjkqjginw/Build/Products/Debug-iphonesimulator/PackageFrameworks/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/CoreSimulator/Devices/E2C4776D-41A3-4C52-B2CB-B6BB80CD4B3F/data/Containers/Bundle/Application/3B8E2E48-FD91-453F-9211-1FC4193ACB51/iosTurknet.app/Frameworks/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/CoreSimulator/Devices/E2C4776D-41A3-4C52-B2CB-B6BB80CD4B3F/data/Containers/Bundle/Application/3B8E2E48-FD91-453F-9211-1FC4193ACB51/iosTurknet.app/Frameworks/Papara.framework/Papara' (no such file), '/Users/mehmet.akyol/Library/Developer/CoreSimulator/Devices/E2C4776D-41A3-4C52-B2CB-B6BB80CD4B3F/data/Containers/Bundle/Application/3B8E2E48-FD91-453F-9211-1FC4193ACB51/iosTurknet.app/Papara.framework/Papara' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/Papara.framework/Papara' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/Papara.framework/Papara' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Papara.framework/Papara' (no such file)
Posted Last updated
.
Post not yet marked as solved
3 Replies
387 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
431 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
790 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
341 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
406 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
331 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.3k 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
599 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
374 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
315 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
287 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
292 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
.