Recent

Author Topic: What do I do to use sqlite3 with OSX?  (Read 8574 times)

luigi65

  • New Member
  • *
  • Posts: 24
    • http://www.lodevelop.org
What do I do to use sqlite3 with OSX?
« on: February 12, 2009, 02:38:00 pm »
Due to failure to work with Zeoslib (see my post http://forum.lazarus.freepascal.org/index.php/topic,6290.0.html), now I try with sqldblaz package (under 'lazarus/component/sqldb'). But I have others problems to use with sqlite, I have dropped a TSQLite3Connection  component on a new form, but when I run the application I obtain an error (see attached image). So I examine the source code and I see in '/lazarus/fpc/2.2.2/source/packages/sqlite/src/sqlite3.inc' file this code at row 27:
Code: [Select]
...
const
{$IFDEF WINDOWS}
  Sqlite3Lib = 'sqlite3.dll';
{$else}
  Sqlite3Lib = 'libsqlite3.so';
{$endif}
...

My system is:
Mac OSX 10.5.4
XCode 3.0
Lazarus 0.9.26
Zeoslib 6.6.4

So I suppose that is not possible to use SQLDBLaz package with OSX because the source code try load libsqlite3.so and not the file libsqlite3.dylib used in OSX, do you think this is right or wrong?


Thanks

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: What do I do to use sqlite3 with OSX?
« Reply #1 on: February 12, 2009, 03:59:28 pm »
I haven't used sqlite but I think this problem has been reported before.

Long-term solution: Please report this as a bug. At the very least there needs to be documentation on how to use sqlite on OS X.

Short-term solution: If you include the sqlite3dyn unit in your app, it looks like it will load the library dynamically rather than declaring it external. Then you can pass in the path to your .dylib in the InitialiseSQLite call. I'm not at my Mac right now, but I believe the sqlite.dylib is included on all Macs and will always be in /usr/lib - check that to make sure - my memory isn't what it used to be.

Thanks.

-Phil

Loesje

  • Full Member
  • ***
  • Posts: 168
    • Lazarus Support website
Re: What do I do to use sqlite3 with OSX?
« Reply #2 on: February 12, 2009, 04:56:50 pm »
This problem is fixed in fpc 2.2.3. You could try a snapshot or fpc 2.2.4rc1.

luigi65

  • New Member
  • *
  • Posts: 24
    • http://www.lodevelop.org
Re: What do I do to use sqlite3 with OSX?
« Reply #3 on: February 13, 2009, 11:42:42 am »
I have looked for fpc 2.2.3 snapshot or 2.2.4rc1 for Mac OSX, but I have not found any, I see only fpc-2.2.2.intel-macosx.dmg.
Could you tell me where I find it or download from?


Thanks


luigi65

  • New Member
  • *
  • Posts: 24
    • http://www.lodevelop.org
Re: What do I do to use sqlite3 with OSX?
« Reply #5 on: February 13, 2009, 03:13:53 pm »
Thank you very much.

I have also downloaded this ftp://ftp.hu.freepascal.org/pub/fpc/beta/2.2.4rc1/source/fpc-2.2.4rc1.source.zip for the sources, is it right?

« Last Edit: February 13, 2009, 03:17:00 pm by luigi65 »

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: What do I do to use sqlite3 with OSX?
« Reply #6 on: February 13, 2009, 04:49:50 pm »
That's right.

 

TinyPortal © 2005-2018