I'm trying to change the install path of a dylib after it has been built. I use otool -L
to check what the current path is. And then I do:
$ install_name_tool -change /my/current/path/libmine.dylib \ /my/new/path/libmine.dylib libmine.dylib
I don't get an error, but nothing changes. If I check the path again the old one is still there. Also the new path is a lot shorter then the old one, so no problem there, and I think the lib is even compiled with extra flag for more filepath space.
Any ideas?
The man page for install_name_tool says that -change is for dependencies. You're trying to change the name of the library itself.
Having just experimented, I found I couldn't change the name of a dylib that appears inside the dylib itself but I could change the names of other dependencies.
Having experimented more: install_name_tool -id newname file
will do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With