dyld: Library not loaded, Reason: image not found

gdb, macos, shared-libraries

Solution

How I fixed it:

- `libCore.so` is a library from ROOT framework, which `MyProg` uses.

- If I understand correctly, the message `Library not loaded: @rpath/libCore.so Referenced from: /Volumes/MyProg Reason: image not found` means that linker found the library, but can't use it.

- Root, during installation uses clang by default. Meanwhile as I prefer gcc and `MyProg` uses gcc.

I have reinstalled root with gcc compiler:

./configure --with-cxx=g++ --with-cc=gcc --with-ld=g++

I have recompiled `MyProg`.

and now I can debug it with gdb.

Problem

I used gdb normally until this week. Now running gdb I see: ``` (gdb) r Starting program: /Volumes/MyProg dyld: Library not loaded: @rpath/libCore.so Referenced from: /Volumes/MyProg Reason: image not found (gdb) ``` How to fix it? I have: - OSX 10.9 - GNU gdb (GDB) 7.6 installed with MacPorts P.S. I have reinstalled gdb and Xcode. This does not help. I see a lot of questions about dyld issues, but obviously I lack experience with libraries on OSX, and they appears to be useless for me. For example this topic: dyld issues library not loaded But how to download library again? Or this topic: Dyld: Library not loaded But how to find out install name? What is `@rpath`?

Original source

Related problems