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

Linker Documentation

Posts under Linker tag

104 Posts
Sort by:
Post not yet marked as solved
11 Replies
3.3k Views
0 In my web projet I'm implementing link with popup with Apple as a provider. I'm allways getting the following error: code: "auth/invalid-credential" message: "Error getting access token from https:/appleid.apple.com,	OAuth2 redirect uri is: https:/myproject.firebaseapp.com/__/auth/handler, response: OAuth2TokenResponse{params: error=invalid_client, httpMetadata: HttpMetadata{status=400, cachePolicy=NO_CACHE, cacheDurationJava=null, cacheImmutable=false, staleWhileRevalidate=null, filename=null, lastModified=null, retryAfter=null, headers=HTTP/1.1 200 OK Here is my code: 	AppleLink = function () { 		let provider = new firebase.auth.OAuthProvider('apple.com'); 		provider.addScope('email'); 		provider.addScope('name'); 		firebase.auth().languageCode = 'pt'; 		linkWithProvider(provider); }; linkWithProvider = function (provider) { 		let email = 'some@email.com'; 		let pass = 'somepassword'; 		firebase.auth().signInWithEmailAndPassword(email, pass).then(function (result) { 				var user = result.user; 				if (user) { 						user.linkWithPopup(provider).then(function (result) { 								providerinput = true; 						}); 				} 		}).catch(function (error) { 				let errorCode = error.code; 		}); }; How do I get pass that error?
Posted
by
Post not yet marked as solved
19 Replies
13k Views
To solve a dependency tangle on an app, I’m trying to write a simple command line tool that would display all the dependencies of a given app or library, and output it in a format suitable for post-processing by graphviz. The idea here is to collect and lay out the output of the otool -L utility, recursively called on all the dependencies of the target app/lib. Unfortunately, when I try otool -L with, say, otool itself, I get this: Dev > otool -L /usr/bin/otool /usr/bin/otool: /usr/lib/libxcselect.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0) Fine. But now: otool -L /usr/lib/libxcselect.dylib /Library/Developer/CommandLineTools/usr/bin/objdump: error: '/usr/lib/libxcselect.dylib': No such file or directory Oops. Indeed, /usr/lib seems mostly empty, and most of what lies inside are links on missing (I assume: invisible) libs. So my question is: where are all the libs gone, and it is possible to bring them back to the surface?
Posted
by
Post marked as solved
8 Replies
30k Views
With xcode 12 first time build fails for working project with previously installed cocoapods framework: ld: framework not found Pods_CopticFind clang: error: linker command failed with exit code 1 (use -v to see invocation) So, what changed from xcode 11.7 to 12? Tried running: pod deintegrate pod update No change, still same error. 2. Change Framework Search path to 'recursive'. No change, still same error.
Posted
by
Post not yet marked as solved
0 Replies
842 Views
I have a framework target in Xcode 11.x to build a Dynamic framework with statically linking some 3rd party libraries using pod file. platform :ios, '9.0' #use_frameworks! target 'Framework' do pod 'DeviceUtil', '~> 2.0' end Now I have a requirement to build a Static framework, and for this I changed the "Mach-O' type to Static Library in 'Framework's' target build settings and able to create Static framework. The generated framework shows all architectures correctly (for architecture i386): (current ar archive random library for all architecutres x8664, armv7 & arm64)._ But the Static framework does not included 3rd party libraries within the Framework binary. How to generate a Static framework using Xcode11.x which includes other 3rd party libs in its binary? Also changing "Mach-O" type is good enough to generate a Static framework or is there any other way that I am missing?
Posted
by
Post not yet marked as solved
6 Replies
9.5k Views
I am stuck with this linking error for days. I recently updated to Xcode12 and my project building and running fine for real devices. But when I try to run for Simulator I am getting this error. building for iOS Simulator, but linking in object file built for macOS, file '..customLib.a' for architecture x86_64 My customLib is a .a library built with Xcode12 too. lipo -info customLib.a  Architectures in the fat file: customLib.a are: armv7 armv7s i386 x86_64 arm64  How to resolve this issue?
Posted
by
Post not yet marked as solved
3 Replies
1.7k Views
I have an SDK that is a static xcframework built against 3 pods (which are configured as static frameworks as well). When I include the SDK bundle in a client project (which also includes the 3 pods as static frameworks) it gives me linkage errors (Undefined Symbol) for every reference in the SDK to these dependencies. The rest of the project (which also relies on them) compiles (and I presume, links) fine. Why can't the SDK xcframework link to them? I'm pretty sure no archs are getting excluded. The XCFramework includes both arm64 for device (iOS) and x8664arm64 for simulator Note, when I convert everything to dynamic frameworks, it works fine.
Posted
by
Post not yet marked as solved
0 Replies
987 Views
Failed to build module 'Accelerate'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5 (swiftlang-1300.0.17.216 clang-1300.0.18.1)', while this compiler is 'Apple Swift version 5.5 (swiftlang-1300.0.19.104 clang-1300.0.18.4)'). Please select a toolchain which matches the SDK.
Posted
by
Post marked as solved
4 Replies
3.8k Views
On Beta 2, on multiple devices, my app stays for 1-2 minutes in the launch screen when the debugger is attached. This used to take a second max in beta 1. If I set a breakpoint, it stops at the end of the launch screen with the following backtrace: Thread 1#0 0x00000001018266d4 in _dyld_debugger_notification () #1 0x0000000101809918 in dyld4::lldb_image_notifier(dyld_image_mode, unsigned int, dyld_image_info const*) () #2 0x00000001017f3334 in dyld4::RuntimeState::notifyDebuggerLoad(dyld3::Array<dyld4::Loader const*> const&) () #3 0x00000001017f68c8 in dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) () #4 0x000000010180980c in start () Running from the home screen without Xcode attached is fast as always. Does anyone have an idea where I can start looking? This makes debugging very hard...
Posted
by
Post not yet marked as solved
0 Replies
1.4k Views
Library not found for -lFirebaseDynamicLinks is the real issue that I am facing in my Xcode 12.4~ followed by linker command. THE SPECIFIC ERROR CODE. : Library not found for -lFirebaseDynamicLinks : Linker command failed with exit code 1 (use -v to see invocation) THE PACKAGE JSON FILE { "name": "Sample Project Name", "version": "0.0.1", "private": true, "engines": { "node": "&gt;=8.15.1" }, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start --reset-cache", "reset": "rm -rf node_modules/ &amp;&amp; npm cache clear &amp;&amp; watchman watch-del-all &amp;&amp; yarn install", "test:file": "jest", "test": "jest --verbose --coverage", "test:coverage": "jest --verbose --coverage --coverageDirectory=coverage --colors", "test:update": "jest --verbose --coverage --updateSnapshot", "test:watch": "jest --verbose --watch", "tsc": "tsc", "lint:fix": "tslint --project tsconfig.json --fix", "tslint-check": "tslint-config-prettier-check ./tslint.json", "postinstall": "node tools/checkNodeVersion.js &amp;&amp; npx jetify", "android": "react-native run-android", "android:apk:debug": "cd android &amp;&amp; ./gradlew assembleDebug &amp;&amp; open ./app/build/outputs/apk/", "android:apk:install": "cd android &amp;&amp; ./gradlew installDebug", "android:apk:release": "cd android &amp;&amp; ./gradlew assembleRelease &amp;&amp; open ./app/build/outputs/apk/", "android:build-bundle": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/", "android:device": "adb reverse tcp:8081 tcp:8081 &amp;&amp; npm run android", "android:log": "react-native log-android", "ios": "react-native run-ios", "ios:log": "react-native log-ios", "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { "@invertase/react-native-apple-authentication": "^2.1.2", "@notifee/react-native": "^1.3.1", "@react-native-community/async-storage": "^1.12.1", "@react-native-community/clipboard": "^1.2.3", "@react-native-community/datetimepicker": "^3.0.2", "@react-native-community/google-signin": "^4.0.3", "@react-native-community/masked-view": "^0.1.10", "@react-native-community/netinfo": "^5.9.7", "@react-native-community/viewpager": "^4.1.6", "@react-native-firebase/analytics": "^12.1.0", "@react-native-firebase/app": "^12.1.0", "@react-native-firebase/auth": "^12.1.0", "@react-native-firebase/dynamic-links": "^12.1.0", "@react-native-firebase/storage": "^12.1.0", "@react-navigation/bottom-tabs": "^5.7.3", "@react-navigation/drawer": "^5.8.7", "@react-navigation/material-top-tabs": "^5.2.16", "@react-navigation/native": "^5.7.2", "@react-navigation/stack": "^5.8.0", "@twotalltotems/react-native-otp-input": "1.3.7", "axios": "^0.20.0", "moment": "^2.27.0", "react": "16.13.1", "react-native": "0.63.0", "react-native-autolink": "^4.0.0", "react-native-countdown-component": "^2.7.1", "react-native-country-picker-modal": "^2.0.0", "react-native-create-thumbnail": "^1.2.1", "react-native-device-info": "^5.6.5", "react-native-dropdownalert": "^4.3.0", "react-native-elements": "^2.1.0", "react-native-fs": "^2.16.6", "react-native-gesture-handler": "^1.8.0", "react-native-image-picker": "^2.3.4", "react-native-keyboard-aware-scroll-view": "^0.9.4", "react-native-localize": "^1.4.1", "react-native-modal": "^11.5.6", "react-native-modal-datetime-picker": "^8.9.3", "react-native-modal-selector": "^2.0.3", "react-native-progress": "^4.1.2", "react-native-reanimated": "^1.10.1", "react-native-responsive-screen": "^1.4.2", "react-native-safe-area-context": "^3.1.1", "react-native-screens": "^2.9.0", "react-native-share": "^3.7.1", "react-native-splash-screen": "^3.2.0", "react-native-super-grid": "^4.0.3", "react-native-svg": "^12.1.0", "react-native-swipe-gestures": "^1.0.5", "react-native-switch-selector": "^2.0.6", "react-native-tab-view": "^2.15.1", "react-native-vector-icons": "^7.0.0", "react-native-video": "^5.1.0-alpha8", "react-native-video-cache": "^2.0.5", "react-native-videoeditorsdk": "^2.5.0", "react-navigation": "^4.4.0", "react-navigation-stack": "^2.8.2", "react-navigation-tabs": "^2.9.0", "react-redux": "^7.2.0", "redux": "^4.0.5", "redux-saga": "^1.1.3", "reflect-metadata": "^0.1.13" }, "devDependencies": { "@babel/core": "^7.8.4", "@babel/runtime": "^7.8.4", "@react-native-community/cli-debugger-ui": "^4.9.0", "@react-native-community/eslint-config": "^1.1.0", "@types/jest": "^25.2.3", "@types/react-native": "^0.63.1", "@types/react-native-vector-icons": "^6.4.5", "@types/react-test-renderer": "^16.9.2", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "babel-jest": "^25.1.0", "eslint": "^6.5.1", "jest": "^25.1.0", "metro-react-native-babel-preset": "^0.59.0", "prettier": "^2.0.4", "react-native-svg-transformer": "^0.14.3", "react-test-renderer": "16.13.1", "typescript": "^3.8.3" }, "jest": { "preset": "react-native", "moduleFileExtensions": [ "ts", "tsx", "js", "jsx", "json", "node" ] } } If I remove the React Native Firebase Dynamic Links library the project works fine otherwise it is dropping this error up above. I have tried all previous versions the same error occurs. I have tried Build Active Architecture also didn't work. And a couple of Xcode settings also. I also tried resetting the derived data and whole Xcode but no fix. I want to use RNDynamicLinks library in my project.
Posted
by
Post not yet marked as solved
6 Replies
710 Views
Runtime crash on macOS 10.13 (High Sierra) with this dyld message: "Incompatible library version: Application requires version 300.0.0 or later, but CoreData provides version 1.0.0" Project configured for 10.12 deployment, and loading seems to work in 10.14 or later - and worked properly built with Xcode prior to 12.5. How do I accommodate 10.12 deliveries? Include the CoreData framework? How's that handled in this case (where included isn't needed for current systems)?
Posted
by
Post marked as solved
1 Replies
810 Views
Hi, I built a SwiftUI app using Xcode 13.0 beta (13A5155e) that runs on an Apple TV 4K running tvos 15.0 beta (19J5314e). This was all fine for the past few weeks, but today, when running the very same app again that was installed by Xcode yesterday, it didn't start anymore and crashed instantly. A few ours ago, it ran just fine and nothing has changed since then and the Apple TV was not restarted. I then tried to run the app through Xcode and got: dyld[817]: Symbol not found: _$ss12TaskPriorityVMa Referenced from: /private/var/containers/Bundle/Application/0AFBBAAB-E85B-452D-8022-724011D49354/appletv.app/appletv Expected in: /usr/lib/swift/libswift_Concurrency.dylib Symbol not found: _$ss12TaskPriorityVMa Referenced from: /private/var/containers/Bundle/Application/0AFBBAAB-E85B-452D-8022-724011D49354/appletv.app/appletv Expected in: /usr/lib/swift/libswift_Concurrency.dylib dyld`__abort_with_payload: 0x1008c7eb8 <+0>: mov x16, #0x209 0x1008c7ebc <+4>: svc #0x80 -> 0x1008c7ec0 <+8>: b.lo 0x1008c7edc ; <+36> 0x1008c7ec4 <+12>: stp x29, x30, [sp, #-0x10]! 0x1008c7ec8 <+16>: mov x29, sp 0x1008c7ecc <+20>: bl 0x1008c63fc ; cerror_nocancel 0x1008c7ed0 <+24>: mov sp, x29 0x1008c7ed4 <+28>: ldp x29, x30, [sp], #0x10 0x1008c7ed8 <+32>: ret 0x1008c7edc <+36>: ret I can still run the app on an emulator without issues, so something about this Apple TV is broken. I also tried resetting it to factory defaults which didn't help. It's probably worth noting, that the first thing Xcode did today when trying to run the app on the device was waiting for symbols to be downloaded, which took forever, so I re-paired the Apple TV to fix this. Any idea how I can continue testing my app on this Apple TV without buying a new one? ;)
Posted
by
Post not yet marked as solved
0 Replies
479 Views
We are seeing mysterious crashes in our app when running on the Apple Silicon machines using Rosetta. The crash is coming from Apple's runtime and dyld libraries, and always has the same kind of stack, but without much useful information. All have the same pattern of 5 stack frames, the bottom being dyld, and then 4 in runtime, but all just addresses, no idea what symbols are being called Sometimes the offset values are the same, other times they are not. When you group them together, we have at least two sets of stacks; but close enough that it appears the same root issue. Only these two libraries appear to be loaded, so perhaps it's a crash on launch before things are adequately setup, or something weird happens during the crash and we are only getting a small part of the picture captured in the .crash, or some corruption happens All are in Apple Silicon machines Some are on macOS 11, and some on macOS 12, so it's not a Monterey beta issue They are all crashing for reason Code Signature Invalid, but this seems unreliable, if indeed we can launch the app afterwards without issue, which appears to be the case (based on log reports we've received). Here is a typical example (with some app info redacted): Version: ??? Code Type: X86-64 (Translated) Parent Process: ??? [1] User ID: 503 Date/Time: 2021-08-06 14:38:06.408 +0200 OS Version: macOS 11.5.1 (20G80) Report Version: 12 Time Awake Since Boot: 21000 seconds Time Since Wake: 15000 seconds System Integrity Protection: enabled Crashed Thread: 0 Exception Type: EXC_BAD_ACCESS (Code Signature Invalid) Exception Codes: 0x0000000000000032, 0x0000000106675000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace CODESIGNING, Code 0x2 kernel messages: VM Regions Near 0x106675000: VM_ALLOCATE (reserved) 106671000-106675000 [ 16K] r--/r-- SM=NUL reserved VM address space (unallocated) --> mapped file 106675000-107ff9000 [ 25.5M] r-x/rwx SM=COW Object_id=695dd8f1 mapped file 107ff9000-107ffd000 [ 16K] r-x/r-x SM=COW Object_id=6aaf57f1 Thread 0 Crashed: 0 runtime 0x00007ffdffe9ac40 0x7ffdffe96000 + 19520 1 runtime 0x00007ffdffea3df4 0x7ffdffe96000 + 56820 2 runtime 0x00007ffdffea35ec 0x7ffdffe96000 + 54764 3 runtime 0x00007ffdffe9a440 0x7ffdffe96000 + 17472 4 dyld 0x000000020683f000 0x20683f000 + 0 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000106675000 x1: 0x000000030d81b730 x2: 0x0000000000000218 x3: 0x0000000000000012 x4: 0x0000000000000004 x5: 0x0000000001984000 x6: 0x0000000000000000 x7: 0x0000000000000a40 x8: 0x0000000000000007 x9: 0x0000000000000012 x10: 0x0000000106675fff x11: 0x0000000100000000 x12: 0x0000000000000000 x13: 0x0000000000000000 x14: 0x0000000000000000 x15: 0x000007d900018601 x16: 0x00000000000000c5 x17: 0x000000000220bef3 x18: 0x000000030d81b073 x19: 0x000000030d81b730 x20: 0x000000030d81aa78 x21: 0x0000000106675000 x22: 0x0000000000000004 x23: 0x0000000106675000 x24: 0x0000000000000003 x25: 0x0000000000000001 x26: 0x000000030d81ab90 x27: 0x000000020683f000 x28: 0x000000030d823960 fp: 0x000000030d81aa20 lr: 0x00007ffdffea267c sp: 0x000000030d81a9b0 pc: 0x00007ffdffe9ac40 cpsr: 0x20000000 far: 0x0000000106675000 esr: 0x92000006 Binary Images: 0x20683f000 - 0x2068dafff dyld (852.2) <57DB2053-BFD5-3683-97C6-F1DB2A1F1D09> /usr/lib/dyld 0x7ffdffe96000 - 0x7ffdffec5fff runtime (203.58) <52A2E5D0-FAA3-34EF-8BB7-07F73718C034> /usr/libexec/rosetta/runtime External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 0 thread_create: 0 thread_set_state: 0 VM Region Summary: ReadOnly portion of Libraries: Total=1048K resident=0K(0%) swapped_out_or_unallocated=1048K(100%) Writable regions: Total=19.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=19.8M(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= STACK GUARD 56.0M 1 Stack 8176K 1 VM_ALLOCATE 10.5M 1 VM_ALLOCATE (reserved) 1132K 3 reserved VM address space (unallocated) __DATA 288K 4 __DATA_CONST 32K 1 __LINKEDIT 272K 4 __TEXT 816K 2 mapped file 4.8G 11 =========== ======= ======= TOTAL 4.9G 28 TOTAL, minus reserved VM space 4.9G 28 Any help or guidance is much appreciated. I cannot say for sure this is an Apple issue, as I have no way to reproduce it reliably, either in our app or another. But it seems doubtful it's a bug in our app. Thank you!
Posted
by
Post not yet marked as solved
2 Replies
292 Views
Hi, I understand that all objects and static libraries linked into one executable need to be compiled with the same deployment target. Is it OK to static link objects that were compiled with the same deployment target but different SDK versions?
Posted
by
aeg
Post not yet marked as solved
0 Replies
464 Views
Hello I program in C++ and I like to compile and run my code through terminal but when I link a library through Xcode this error is showing in Terminal main.cpp:5:10: fatal error: 'Console.h' file not found #include &lt;Console.h&gt;          ^~~~~~~~~~~ 1 error generated. and I the library is linked because it work fine in Xcode console but I can't use system(); because some TERM environment variable not set. and sorry if this is a easy question to answer and google but I didn't now how to google some fix and I used Mac like for 6 days so I very new to all this
Posted
by
Post not yet marked as solved
3 Replies
5k Views
Hi All, I'm writing a c program on my m1 macbook, but when i compiled the project, error occurs: Undefined symbols for architecture arm64: "_fp", referenced from: _main in main.c.o "_init", referenced from: _main in main.c.o ld: symbol(s) not found for architecture arm64 and also, when i exec ld command, it will return some warnings: ld: warning: platform not specified ld: warning: -arch not specified ld: warning: No platform min-version specified on command line ld: no object files specified I only install the xcode command line tools and use vscode, i believe it's a link problem but have no idea if it's a bug or my config fault. Someone has any idea?Thanks
Posted
by
Post not yet marked as solved
0 Replies
299 Views
Hello there, I added the library I wrote to a simple project. It is not triggered when I call a function in the library. When I put the breakpoint and remove the breakpoint, the function is triggered. This problem started happening when I upgraded to xCode 12.5. Can you help me?
Posted
by
Post not yet marked as solved
4 Replies
2.5k Views
Hello! I'm working on a new app, and DYLD_PRINT_STATISTICS=1 is not working - i.e., not producing any output. Build platform: MacBook Pro (15-inch, 2018) macOS Monterey, 12.0 beta 6 (21A5506j) Xcode 13.0 beta 5 (13A5212g) Test device: iPad 8th generation iPadOS 15.0 beta 8 (19A5340a) I'm setting it as usual in Product -> Scheme -> Edit Scheme, then going to "Run" tab on the left and choosing "Arguments" on the top. In that screen I enter "DYLD_PRINT_STATISTICS" for Name and "YES" for Value. Nothing prints. I also tried: Using "1" for Value instead of "YES" Entering "DYLD_PRINT_STATISTICS=YES" as Name and leaving Value blank Entering "DYLD_PRINT_STATISTICS=1" as Name and leaving Value blank Every combination of the above, but as command-line arguments instead of environment variables. Also, I tried "DYLD_PRINT_APIS" as Name and "YES" as Value, and that works normally. What's going on here? Is it something with the all-SwiftUI lifecycle? An issue with the beta macOS/Xcode/iPadOS? Thanks!
Posted
by
Post not yet marked as solved
0 Replies
918 Views
I am trying to build an archive for a RN project and I face this issue ld: warning: directory not found for option '-L-L/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/publife-citzzdlmmmmsakbpzutdbpcewagt/Build/Intermediates.noindex/ArchiveIntermediates/publife/BuildProductsPath/Release-iphoneos/Braintree' ld: library not found for -lBraintree clang: error: linker command failed with exit code 1 (use -v to see invocation) any clue what's the problem, or maybe solution?
Posted
by
Post not yet marked as solved
9 Replies
661 Views
Hi, I'm trying to load libgcrypt library (brew install libgcrypt) with dlopen/dlsym but getting a crash when I use RTLD_LAZY | RTLD_LOCAL mode with dlopen. Any other combination works, for example: RTLD_LAZY | RTLD_GLOBAL RTLD_NOW | RTLD_GLOBAL RTLD_NOW | RTLD_LOCAL I have attached a tiny sample program to reproduce the issue: $ gcc -o dyld_test dyld_test.c $ ./dyld_test gcry_check_version dyld: lazy symbol binding failed: Symbol not found: __gcry_check_version Referenced from: /usr/local/lib/libgcrypt.dylib Expected in: flat namespace dyld: Symbol not found: __gcry_check_version Referenced from: /usr/local/lib/libgcrypt.dylib Expected in: flat namespace I have tried to build dyld myself but failed to succeed. https://opensource.apple.com/source/dyld/dyld-852.2/ Any help would be really appreciated. Thank you, Aleix dyld_test.c
Posted
by