Sorry if this has been asked in the past, but I haven't been able to find an answer.

I am using Lazarus 1.6.4, and FPC 3.0.0

I have a Lazarus application (on Ubuntu, works OK compiling on Windows as well), which accesses a MySQL DB using the builtin mysqldb components.

Program compiles fine on the Mac but when I try to connect to the DB it complains that it can't find libmysqlclient.dylib.18 or libmysqlclient.dylib, problem one is the filename as on the mac the file list libmysqlclient.18.dylib, so OK just symlink.problem two is where does the file go? have tried various locations (/usr/lib, same directory as the executable....), but it doesn't find it. I have also tried setting LD_LIBRARY_PATH & DYLD_LIBRARY_PATH but to no avail.

Could one of the wonderful guru's out there please point me in the right direction as I seem to be going round and round in circles.

Program compiles fine on the Mac but when I try to connect to the DB it complains that it can't find libmysqlclient.dylib.18 or libmysqlclient.dylib,

Review the MySQL source and see how it's linking to or loading the library. There are probably two ways the source can be compiled, with linklib or so it uses LoadLibrary (loading the library "dynamically").

Since MySQL is not a standard library on OS X, you'll probably want to include the .dylib in your app's bundle, in the Frameworks subfolder.

the mysqldb component uses dynamic(runtime) loading using LoadLibrary. I have already been there. However it doesn't set any distinct paths to the library, relying on the OS to sort it out. Works fine with Linux and Windows they find it fine (as long as you put it in the right place).

Haven't tried using the Frameworks Folder, so will give this a go, Since your message I can see that that is where MySQLWorkbench has the library loaded. So I will give that a try.

Haven't tried using the Frameworks Folder, so will give this a go, Since your message I can see that that is where MySQLWorkbench has the library loaded. So I will give that a try.

That's the .app bundle's Frameworks subfolder, NOT the system's. However, in this case if you think it's relying on the OS default locations, then you need to study up on that. It's possible that the code just doesn't work, I suppose. I doubt if MySQL is used much on Mac. Certainly I don't think I've ever run across an app that uses it. Since Sqlite is a standard library on all Macs and all iOS devices, that's used quite commonly.

Typically apps include the libraries they need as part of their .app bundles. That way the user doesn't have to install anything else and the app is self-contained. See how the apps on your Mac do it, eg, iTunes.app.