Recent

Author Topic: [SOLVED] lazarus+zeos+firebird on mac os x  (Read 11524 times)

sorinr

  • New Member
  • *
  • Posts: 19
[SOLVED] lazarus+zeos+firebird on mac os x
« on: February 20, 2011, 12:50:39 pm »
Hello Everybody,

I'm trying to recompile a Lazarus project developed on win32 platform and the only problem I have is regarding firebird database connectivity:
1. I am using Lazarus 0.9.28 on both platforms Mac OS X 10.6.6 and Win 32;
2. I have installed Firebird 2.1.3 classic server on both machines;
3. On both versions of Lazarus I have installed the same Zeoslib library 6.6.6

PROBLEM:
On my win32 platform the ZConnection works fine instead on my Mac OS X platform I get the "None of the dynamic libraries can be found: libfbclient.so.21, libfbclient.so" when I'm trying to put the ZConnection to True.

I can connect without any problems to my database on both machines when using FlameRobin or isql.

I have checked that all .dylib are in the right framework/libraries place. I have not found instead any firebird client .so libraries.

Any idea to solve this problem.

Thank you all in advance for your time.
« Last Edit: February 24, 2011, 07:34:37 pm by sorinr »

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: lazarus+zeos+firebird on mac os x
« Reply #1 on: February 20, 2011, 04:33:32 pm »
Offhand I would guess that it doesn't work on OS X. A search turns up this:

http://www.lazarus.freepascal.org/index.php?topic=8128.0

Looking at ZPlainFirebird21.pas, I would guess that it was never intended to run on OS X.

Thanks.

-Phil

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: lazarus+zeos+firebird on mac os x
« Reply #2 on: February 20, 2011, 05:32:08 pm »
You can do two things:

1. Either create the .so files as symbolic links to the .dylib files, which is only an options if you won't run the programs on your own MAC (unless you want to add these links to all Macs it will run on.

2. What I did when I had similar issues using SQLITE was to change the ZEOS code.  Somewhere in the source file, specific to the DBMS you are using are a couple of lines that point to the dynamic link libraries (DLL for Win and .so for Linux).  Just add some for the Mac, pointing to the dylibs. And then recompile. Worked for me.
1.0/2.6.0  XP SP3 & OS X 10.6.8

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: lazarus+zeos+firebird on mac os x
« Reply #3 on: February 20, 2011, 05:34:56 pm »
Meant to say ... "If you only run the program on your own Mac"
1.0/2.6.0  XP SP3 & OS X 10.6.8

cpalx

  • Hero Member
  • *****
  • Posts: 619
Re: lazarus+zeos+firebird on mac os x
« Reply #4 on: February 20, 2011, 05:42:34 pm »
do as Arbee said,

i made the symbolic links, but with libpgsql for PostgerSQL, and works perfectly. But dont use 0.9.28.x in Mac, it has a lot of problems, instead of use last svn 0.9.29.x

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: lazarus+zeos+firebird on mac os x
« Reply #5 on: February 20, 2011, 06:31:44 pm »
By the way:
Changing it in ZEOS code is done in the file ZPlainxxxxx.pas where xxxxx is the DBMS you're aiming for.

So in this will be ZPlainFirebird21.pas (or another version number if that's what you're using) In there you will find something this:


Code: [Select]
const
  WINDOWS1_DLL_LOCATION   = 'fbclient21.dll';
  WINDOWS1_DLL_LOCATION_EMBEDDED = 'fbclientd21.dll';

  LINUX1_DLL_LOCATION   = 'libfbclient.so.21';
  LINUX1_DLL_LOCATION_EMBEDDED = 'libfbembed.so.21';
  LINUX1_IB_CRYPT_LOCATION = 'libcrypt.so.21';

These constant values are used at the bottom of the code.

If you want to make a terrible short cut (for instance if you never ever use Linux) you could just change the LINUX constants to mention .dylib files in stead.
Better of course to add MAC versions and make sure they are

Will be a little cumbersome given the fact that Firebird can be embedded or server, but should not be rocket science either.
1.0/2.6.0  XP SP3 & OS X 10.6.8

sorinr

  • New Member
  • *
  • Posts: 19
Re: lazarus+zeos+firebird on mac os x
« Reply #6 on: February 21, 2011, 09:00:58 am »
Hi,

Thank you all for your suggestions. I will try Arbee's second one and change only the name of the libs under the Linux const part. I think this will not affect my project because on each machine win32, mac osx or linux I will have the right compiled zeos libraries.

As I will use Firebird 2.1.3 server version on all machines it should work.

I'll come back soon with results.

Thanks again to all.

sorinr

  • New Member
  • *
  • Posts: 19
[SOLVED]Re: lazarus+zeos+firebird on mac os x
« Reply #7 on: February 21, 2011, 09:37:26 am »
Hi,

I've just modified the LINUX1_DLL_LOCATION to point to 'libfbclient.dylib' instead of 'libfbclient.so.21' recompiled the zeos lib and everything works fine.

I have recompiled my project on win32 machine where the zeos lib is the original one and
of course works fine.

I'll try to recompile the project also on an Ubuntu machine to check if everythings its ok.

Thank you Arbee for your idea and thanks to all for reading my post.

I can say: PROBLEM SOLVED! :D
« Last Edit: February 24, 2011, 07:32:21 pm by sorinr »