#41749: gdb: dyld: Library not loaded @rpath/libCore.so --------------------------+---------------------- Reporter: alkulakov@… | Owner: dweber@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: gdb | --------------------------+---------------------- Comment (by davydden@…): Replying to [comment:6 cal@…]:
It is '''not''' necessary to set `DYLD_LIBRARY_PATH` in this case. If you ensure the binary you are running contains the correct absolute path of the library it will work just fine without `DYLD_LIBRARY_PATH` set. To do this, use `install_name_tool -change` on the binary, or ensure the libraries you link against contain the correct absolute path to themselves as the ID load command (the first line printed in `otool -L` output) before linking the binary. You can change the ID using `install_name_tool -id` or using the `-install_name` option of the `ld64` linker at link time of the library.
this is far from being optimal. I am running executables which are linked against total of some 20 libraries (which are also liked one against another). Some with full path, some with just library names. This never bothered me since I had DYLD_FALLBACK_LIBRARY_PATH set up correctly and thus executable always run fine. I just spent some several hours to actually trace this problem starting from Eclipse not working in parallel debug mode for my application. I really hope this is not a "feature" of the new gdb... -- Ticket URL: <https://trac.macports.org/ticket/41749#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X