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

59 results found
Sort by:
Post not yet marked as solved
86 Views

dyld library crash with dlopen RTLD_LAZY | RTLD_LOCAL

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
Asked Last updated
.
Post not yet marked as solved
37 Views

IOKit can't load in Xcode12.5 when running App in iphone12mm

iOS version is14.2.1(18B121) dyld: Library not loaded: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit  Referenced from: /private/var/containers/Bundle/Application/27933966-3944-4FF9-907F-2C69CE0EDA4E/.app/  Reason: image not found dyld: launch, loading dependent libraries DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib
Asked
by yujieiii.
Last updated
.
Post not yet marked as solved
53 Views

My Widget Extension will not build with Bitcode

I have just updated my iMac to an M1 and now one of my projects is giving me these warnings for 3 of the libraries embedded in a Widget Extension: ld: warning: all bitcode will be dropped because '/Users/..../DJSwiftHelpers_Extension' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. I understand that the app needs all libraries to be built with bitcode in order to be bitcode compatible. 2 of the libraries are my own, one in fact is actually built inside the same project and all have bitcode enabled. The libraries have 2 versions, 1 with "Allow app extension safe API only" and the other without. It's only the app extension libraries that are an issue. Those embedded in a Watch extension are fine. Those embedded in Intents are fine. It's just the Widget extension that complains so I don't think the issue is the Frameworks. I can clear the warnings by disabling bitcode for the Widget Extension, however on uploading the app to the App Store, bitcode is in fact disabled for the whole app. So I guess my questions are: Why has this only become an issue on an M1 mac and not on my Intel Mac? Can widget extensions support bitcode? Or is the bitcode setting just ignored? Is it really impossible to use bitcode when providing a Widget Extension?
Asked
by dazboj.
Last updated
.
Post not yet marked as solved
84 Views

DYLD_PRINT_STATISTICS not working / Xcode 13.0 beta / iOS 15.0 beta 8

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!
Asked
by drewster.
Last updated
.
Post not yet marked as solved
99 Views

ld: library not found for -lBraintree

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?
Asked
by Desouky.
Last updated
.
Post not yet marked as solved
541 Views

Library not found for -lFirebaseDynamicLinks

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": ">=8.15.1" }, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start --reset-cache", "reset": "rm -rf node_modules/ && npm cache clear && watchman watch-del-all && 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 && npx jetify", "android": "react-native run-android", "android:apk:debug": "cd android && ./gradlew assembleDebug && open ./app/build/outputs/apk/", "android:apk:install": "cd android && ./gradlew installDebug", "android:apk:release": "cd android && ./gradlew assembleRelease && 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 && 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.
Asked Last updated
.
Post not yet marked as solved
88 Views

Framework does not trigger

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?
Asked
by Procenne.
Last updated
.
Post not yet marked as solved
4.2k Views

Missing librairies in /usr/lib on Big Sur?

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?
Asked Last updated
.
Post not yet marked as solved
281 Views

ld: symbol(s) not found for architecture arm64

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
Asked
by ukujou.
Last updated
.
Post not yet marked as solved
182 Views

how can I fix a C++ library error

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 <Console.h>          ^~~~~~~~~~~ 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
Asked Last updated
.
Post not yet marked as solved
92 Views

Linking together objects compiled with different SDKs

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?
Asked
by aeg.
Last updated
.
Post marked as solved
718 Views

App takes forever to launch on Xcode 13 Beta 2 and iOS 15 Beta 2

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...
Asked
by Gernot.
Last updated
.
Post not yet marked as solved
180 Views

Crashes in runtime library under Rosetta

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!
Asked
by larry_mac.
Last updated
.
Post marked as solved
282 Views

App crashes with Symbol not found on tvos 15.0

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? ;)
Asked
by S0mbdy.
Last updated
.
Post not yet marked as solved
141 Views

CoreData dyld crash using Xcode 12.5 with macOS 10.12 deployment

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)?
Asked Last updated
.