Page 1 of 1
[Lazarus] [OSX] Sqlite in OSX - Solution
Posted: 27.07.2009, 11:52
by laguna
Not correct compile in OSX file ZPlainSqlite3.pas
Row (60)
- LINUX_DLL_LOCATION = 'libsqlite3.so';
+ {$ifdef Unix}
+ {$ifdef Darwin}
+ // Darwin is the base OS name of Mac OS X, like NT is the name of the Win2k/XP/Vista kernel. Mac OS X = Darwin + GUI.
+ LINUX_DLL_LOCATION = 'libsqlite3.0.dylib';
+ {$else}
+ LINUX_DLL_LOCATION = 'libsqlite3.so';
+ {$endif}
+ {$endif}
Posted: 08.08.2009, 06:23
by mdaems
Hi,
I suppose it compiled well, but just didn't find the right library at runtime?
I'm not sure if this is the right solution because :
- We can't start adding ifdefs for all available unix-like distributions with all their different naming schemes for libraries
- I think this only works for the sqlite 3.0 version? So the same problem reappears when the name changes to 3.1 for some reason.
I believe the solution here is to provide a symlink named libsqlite3.so pointing to the right library on your system.
In the future there might be a more flexible way to solve this. On the moment changes are pending that might allow you to point to the right library when building or running the program. This isn't done yet, however.
Mark
Posted: 08.08.2009, 16:34
by laguna
My solution is for MacOsX indeed verify the presence of Darwin and otherwise step instruction in the old Unix
file ZPlainSqlite3.pas
zconnection->Protocol=Sqlite-3
Code: Select all
WINDOWS_DLL_LOCATION = 'sqlite3.dll';
{$ifdef Unix}
{$ifdef Darwin}
// Darwin is the base OS name of Mac OS X
LINUX_DLL_LOCATION = 'libsqlite3.0.dylib';
{$else}
// All Unix like
LINUX_DLL_LOCATION = 'libsqlite3.so';
{$endif}
{$endif}