I'm trying to run an existing application to see how well it works with the latest Xcode beta and to try to use SwiftUI in an existing project. When I run the project on Simulator I get the following run-time crash:
dyld: Symbol not found: __ZTISt11logic_error
Referenced from: /Users/lucas/Library/Developer/CoreSimulator/Devices/224333CF-0388-4F57-9633-6CAB37B33510/data/Containers/Bundle/Application/<Guid>/<AppName>.app/<AppName>
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
in /Users/<name>/Library/Developer/CoreSimulator/Devices/224333CF-0388-4F57-9633-6CAB37B33510/data/Containers/Bundle/Application/<Guid>/<AppName>.app/<AppName>
Setting everything to iOS 13 made the error go away but that won't work in the near future. Also tried to remove anything related to Audio and AV frameworks but that didn't help.
Apparently same bug, but with different symbol:
dyld: Symbol not found: __ZTISt9bad_alloc
Referenced from: <bla-bla-bla>
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.1.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
in <bla-bla-bla>
#Jeremy's answer worked for me. To help find it, the file is at
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox.tbd
and the lines you take out are:
weak-def-symbols: [ __ZTI11CAException, __ZTIN8DSPGraph9ExceptionE, __ZTINSt3__112bad_weak_ptrE,
__ZTINSt3__117bad_function_callE, __ZTISt11logic_error, __ZTISt12length_error,
__ZTISt12out_of_range, __ZTISt13runtime_error, __ZTISt16invalid_argument,
__ZTISt18bad_variant_access, __ZTISt8bad_cast, __ZTISt9bad_alloc,
__ZTISt9exception, __ZTS11CAException, __ZTSN8DSPGraph9ExceptionE,
__ZTSNSt3__112bad_weak_ptrE, __ZTSNSt3__117bad_function_callE,
__ZTSSt11logic_error, __ZTSSt12length_error, __ZTSSt12out_of_range,
__ZTSSt13runtime_error, __ZTSSt16invalid_argument, __ZTSSt18bad_variant_access,
__ZTSSt8bad_cast, __ZTSSt9bad_alloc, __ZTSSt9exception ]
This is a bug in the iOS 13 Beta SDK. You can hack around it by editing the AudioToolbox.tbd file within the SDK to remove the __ZTISt11logic_error (et al) symbols that shouldn't have been exported from there, or you can edit your link line to include -lc++ before -framework AudioToolbox (such that the static linker uses the correct references in libc++ rather than the once that were incorrectly referenced from AudioToolbox).
Or you can wait for a future beta with the fix ;)
I had crash with quite same error:
dyld: Symbol not found: __ZTISt11logic_error
Referenced from: <bla-bla-bla>
Expected in: /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
in <bla-bla-bla>
But I faced it when I was compiling own C++ project in Clion, so nothing linked with Simulator or iOs.
At that time I had XCode 10.2.1. I have tried multiple stuff to fix this crash, but nothing helped.
Luckily I found this post, so I downgraded my XCode to 10.1 and it's Command Line Tools. And it helped me!
So, even if my advice may not help with XCode 11 beta, I hope it can help other developers with the same error as you have.
This is an Xcode bug, but with a work-around. In your target's "Frameworks Libraries & Embedded Content" section, add libc++.tbd and make sure it's the at the top of the list. That should be all your need.
When I load the haskell / gloss examples (so far I've tried Wave and Snow), I seem to be getting an error with finding something in the GLUT shared libraries. What might cause this error and how can I fix it?
can't load .so/.DLL for: /Users/jd/sandbox/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_J2ZZFJOYOcH4hQYFlXhEPp/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib (dlopen(/Users/jd/sandbox/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_J2ZZFJOYOcH4hQYFlXhEPp/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib, 5): Symbol not found: _glutBitmap8By13
Referenced from: /Users/jd/sandbox/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_J2ZZFJOYOcH4hQYFlXhEPp/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib
Expected in: flat namespace
in /Users/jd/sandbox/.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_J2ZZFJOYOcH4hQYFlXhEPp/libHSGLUT-2.7.0.1-0waW9bZutCf5s5H5zSV4Oh-ghc7.10.1.dylib)
This is on mac OSX 10.9.5 with GHC 7.10.1
I've compiled my SFML program with g++ and that seems to be working fine now (had issues with it previously), however when I try to run the resulting output, I get the following error message:
dyld: lazy symbol binding failed: Symbol not found: __ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE
Referenced from: /Users/fabricecastel/Work/Game_Projects/SFML_tutorials/./a.out
Expected in: /usr/local/lib/libsfml-graphics.2.dylib
dyld: Symbol not found: __ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE
Referenced from: /Users/fabricecastel/Work/Game_Projects/SFML_tutorials/./a.out
Expected in: /usr/local/lib/libsfml-graphics.2.dylib
Trace/BPT trap: 5
I've checked the folder in question and libsfml-graphics.2.dylib isn't missing. Besides that I'm at a total loss as to what the issue is and how I'm supposed to fix it. Seems to me that the RenderWindow symbol isn't included in the dylib but it should be. We're talking SFML 2.1 here, not some obscure amateur project. What's up with that?
The only way I could reproduce these errors is when GCC and Clang version of SFML are mixed. Here are two procedures that create the same errors.
First procedure
install the GCC version
compile your application (successfully)
install the Clang version
run your application
Second procedure
install the Clang version
compile your application (successfully)
install the GCC version
run your application
When you install another runtime, you need to carefully rebuild from scratch your application. That is, remove the final binary as well as any .o files before compiling.
I get this error on my Mac OS Lion when I use gcc make:
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
./configure.sh: line 364: 18386 Trace/BPT trap: 5 $QTDIR/bin/qmake "$SRCDIR/$product.pro"
qmake failed
Note: I installed Macports in my machine. This used to work before, is this a known issue with MacPorts?
you can use the built in libiconv by selecting your target, going to the Build Phases tab and adding it to the link libraries and frameworks build phase.
as a general rule if you are missing linker symbols you can look up the symbol in your project and see what header they are from, and you can then usually figure out the appropriate library or framework.
in this case it tells you what library it is expecting...
you will want to use the built in version for a dynamic library, because with default linker flags, if this built product were to get moved to another computer it would try to resolve the symbols at run time in that location, and crash.
I've gotten MDB-Tools compiled for OSX, but when I try to run a sample command line program on another computer I get this error:
dyld: Library not loaded: /opt/local/lib/libglib-2.0.0.dylib
Referenced from: /Users/dev/mdb/mdb-test
Reason: image not found
Trace/BPT trap: 5
I believe that this means that the target system is missing a library and I think its something to do with linkage, but I'm not exactly positive how to go about fixing this. Could anyone point me in the right direction?
The /opt/local directory is typically used by MacPorts. Your compiled program has a dependency on glib from MacPorts. You either need to install that on the machines where you want to run your program or you need to bundle together your program and all of the libraries it depends on.
Check Apple's Dynamic Library Programming Topics.
Yes, I had hit similar issue while upgrading vim on Mac.
$ vi linkedlist.cc
dyld: Library not loaded: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/Python
Referenced from: /usr/local/bin/vim
Reason: image not found
Abort trap: 6
To solve the problem, I tried to upgrade packages.
$ brew update
Already up-to-date.
$ brew upgrade
It started working after doing upgrades.