[Lazarus] [OSX] Sqlite in OSX - Solution

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
laguna
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 27.07.2009, 11:46
Contact:

[Lazarus] [OSX] Sqlite in OSX - Solution

Post 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}
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
laguna
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 27.07.2009, 11:46
Contact:

Post 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}
Post Reply