Fail to load library libmysqlclient.18.dylib

I was running root on mac OS X (10.9.1)
I am using the TSQLServer class and when I ran into this error:
dlopen error: dlopen(/Users/haoli/root/lib/libRMySQL.so, 9): Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/haoli/root/lib/libRMySQL.so Reason: image not found Load Error: Failed to load Dynamic link library /Users/haoli/root/lib/libRMySQL.so Error in <TCint::AutoLoad>: failure loading library libRMySQL.so for class TMySQLServer Error in <TPluginHandler::SetupCallEnv>: class TMySQLServer not found in plugin RMySQL Error: illegal pointer to class object db0 0x0 1828 /Users/haoli/root/macros/test001.C:61: *** Interpreter error recovered ***

I looked up the libRMySQL.so, and I ended up getting this:

LiHaos-MacBook-Pro:root haoli$ otool -L lib/libRMySQL.so lib/libRMySQL.so: @rpath/libRMySQL.so (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) @rpath/libNet.so (compatibility version 0.0.0, current version 0.0.0) libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0) @rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libCint.so (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)

Also, I looked up the config.log and it seems that it’s fine.

Checking for mysql_config ... Checking for libmysqlclient version >= 3.23.* Result: ok

Is there anyway to diagnose this problem?

Hao

Hello,

You need to add the path of libmysqlclient.18.dylib to your $DYLD_LIBRARY_PATH, something like: export $DYLD_LIBRARY_PATH=mysql_config --variable=pkglibdir:$DYLD_LIBRARY_PATH

Cheers,
Kun

[quote=“lihaoahil”]I was running root on mac OS X (10.9.1)
I am using the TSQLServer class and when I ran into this error:
dlopen error: dlopen(/Users/haoli/root/lib/libRMySQL.so, 9): Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/haoli/root/lib/libRMySQL.so Reason: image not found Load Error: Failed to load Dynamic link library /Users/haoli/root/lib/libRMySQL.so Error in <TCint::AutoLoad>: failure loading library libRMySQL.so for class TMySQLServer Error in <TPluginHandler::SetupCallEnv>: class TMySQLServer not found in plugin RMySQL Error: illegal pointer to class object db0 0x0 1828 /Users/haoli/root/macros/test001.C:61: *** Interpreter error recovered ***

I looked up the libRMySQL.so, and I ended up getting this:

LiHaos-MacBook-Pro:root haoli$ otool -L lib/libRMySQL.so lib/libRMySQL.so: @rpath/libRMySQL.so (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) @rpath/libNet.so (compatibility version 0.0.0, current version 0.0.0) libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0) @rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0) @rpath/libCint.so (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)

Also, I looked up the config.log and it seems that it’s fine.

Checking for mysql_config ... Checking for libmysqlclient version >= 3.23.* Result: ok

Is there anyway to diagnose this problem?

Hao[/quote]