OS X 10.11 - El Capitan - Change the shared library identifier

After upgrading to OS X 10.11 El Capitan I'm having trouble with my libraries due to SIP and rootless:


dyld: Library not loaded: libmysqlclient.18.dylib

Referenced from: /Users/jose/Library/Developer/Xcode/DerivedData/myProject-dvophlqioihoungqcdkihvpzskee/Build/Products/Debug/SaDPeMAC.app/Contents/MacOS/myProject

Reason: image not found


I have changed the shared library identifier of libmysqlclient.18.dylib so that dyld looks for the binary relative to my application binary with this:


@executable_path/../Frameworks/libmysqlclient.18.dylib libmysqlclient.18.dylib


This works fine in my Mac Book Pro, but when a do the same in my iMac27 it throws the following error:


/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: libmysqlclient.18.dylib (No such file or directory)


I don't see any difference between my MBP and my iMac27. Any ideas?


Thanks in advance.

Replies

"Hi


I am having the same problem on a macbook air. Since I upgraded to El Capitan I can't run my mysql apps.


What did you do to change " the shared library identifier of libmysqlclient.18.dylib so that dyld looks for the binary relative to my application binary"?


It seems the upgrade removed the lib from /usr/lib, so I downloaded the latest build (10.8 osx and v6.1.6) and linked the library into /usr/lib. Initially, I got an error saying it could not connect to the socket /tmp/mysql.sock, so I fixed that by changing XAMMP configuration and that seems okay.


I now just get BAD_ACCESS when running the app, but no diagnostic of any use.


Thanks


Nick

a bit late, but hpe can help


1) ln ..

does not work any more in Catalina

2) mysql lib are newer.. with less bugs but as always bad....

so ...


https://stackoverflow.com/questions/17465902/use-of-external-c-headers-in-objective-c/60130956#60130956