Dyld Library Not Loaded Reason Image Not Found

I've been running into a dyld loading issue while trying to build a Swift command line application. My Package.swift is fairly simple, with dependencies on only ArgumentParser and SwiftToolsSupport:

  • Dyld: Library not loaded:. Reason: no suitable image found. It launches fine in the iPhone 11 simulator. It launches fine on my gf's iPhone XR which still has iOS 13.3. Tried different pods (SwiftSoup and GRDB.swift) - Tried updating CocoaPods to latest stable and latest beta versions. Tried different projects.
  • MacOS BigSur Python3 - dyld: Library not loaded: trillionanswers Unladen Swallow. Reason: image not found Has anyone run into this issue before?

Library

Dyld Library Not Loaded Reason Image Not Found On Youtube

It runs fine via swift run. Here's what I'm doing to produce a release executable:
However, when I run the executable, I get the issue:

What I found out was that there was a weird dependency with openssl and since I installed openssl via pip it was not linked properly to /usr/local/opt and linking via brew was also not working. A simple solution was to uninstall both openssl and libevent via brew and reinstalling them via brew. Dyld: Library not loaded in Swift executable release build You’re now watching this thread and will receive emails when there’s activity. Click again to stop watching or visit your profile/homepage to manage your watched threads. Dyld: Library not loaded: /usr/local/lib/libwep Referenced from: /usr/bin/xcode-select Reason: no suitable image found. Did find: /usr/local/lib/libwep: code.

Not
I've run otool -L /usr/local/bin/progressReason, which outputs the paths:Dyld library not loaded reason image not found online
  • /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1677.104.0)

  • /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

  • /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)

  • @rpath/libSwiftToolsSupport.dylib (compatibility version 0.0.0, current version 0.0.0)

  • /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1677.104.0)

  • @rpath/libswiftCore.dylib (compatibility version 1.0.0, current version 1103.8.25)

  • @rpath/libswiftDarwin.dylib (compatibility version 1.0.0, current version 0.0.0)

  • @rpath/libswiftFoundation.dylib (compatibility version 1.0.0, current version 0.0.0)


I can get the release executable to work by copying libSwiftToolsSupport.dylib into /usr/local/lib/ and overriding its install path on the executable:
However, this is seems like a bad workaround. Is there a better way to do this, that doesn't require touching the local filesystem? Note that I'm not using Xcode, purely the Package.swift and command line arguments (e.g. swift build -c release).

Today I am trying to get 'kQOAuth':http://gitorious.org/kqoauth/kqoauth to run on OSX. ('Yesterday it was Windows':http://developer.qt.nokia.com/forums/viewthread/5976/)

Dyld Library Not Loaded Reason Image Not Found

I built it and did make install with this output:

@alis-imac:kqoauth ali$ sudo make install
Password:
cd src/ && make -f Makefile install
rm -f -r '/Users/ali/QtSDK/Desktop/Qt/473/gcc/lib/kqoauth.framework'
cp -f -R '../lib/kqoauth.framework' '/Users/ali/QtSDK/Desktop/Qt/473/gcc/lib/kqoauth.framework'
cp -f '../lib/kqoauth.framework/kqoauth.prl' '/Users/ali/QtSDK/Desktop/Qt/473/gcc/lib/kqoauth.framework/kqoauth.prl'
cp -f /Traktor-Scrobbler/libs/kqoauth/kqoauth.prf /Users/ali/QtSDK/Desktop/Qt/473/gcc//mkspecs/features/
cd examples/ && make -f Makefile install
make[1]: Nothing to be done for install'. cd tests/ && make -f Makefile install cd ut_kqoauth/ && make -f Makefile install make[2]: Nothing to be done forinstall'.
cd ft_kqoauth/ && make -f Makefile install
make[2]: Nothing to be done for `install'.
alis-imac:kqoauth ali$
@

kQOAuth resides in the subfolder libs/kQOAuth of my project.

I added the osx-part of the example's .pro-file to my .pro-file and adjusted the path:

@macx {
CONFIG -= app_bundle
QMAKE_POST_LINK += install_name_tool -change kqoauth.framework/Versions/0/kqoauth
lib/kqoauth.framework/Versions/0/kqoauth $${TARGET}
}@

Everytime I'm trying to run my project I get this error:

Dyld Library Not Loaded Reason Image Not Found Free

@dyld: Library not loaded: lib/kqoauth.framework/Versions/0/kqoauth
Referenced from: /macbuild/MyProject
Reason: image not found
The program has unexpectedly finished.@

What did I specify wrong?