Recent

Author Topic: [SOLVED] UIB: can't load client library  (Read 17433 times)

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
[SOLVED] UIB: can't load client library
« on: October 27, 2015, 11:43:59 am »
Hi all.

I am using in the project trunk UIB and FB 2.5.2 on Win7 x 64
When I try to load the runtime fbclient.dll
Code: Pascal  [Select][+][-]
  1. const
  2. LibName: String = 'c:\Program Files (x86)\Firebird\Firebird_2_5_2\bin\fbclient.dll';
  3. ...
  4. UIBDBase.LibraryName:= LibName;
  5. UIBDBase.Connected:= True;
  6. ...

then get the error
Quote
Can't load library: fbclient.dll

Tried to set the type TFileName, string error persists
When you set this property in DesignTime error does not occur.

Has anyone have any ideas?
« Last Edit: October 28, 2015, 04:47:58 pm by zoltanleo »
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8833
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: UIB: can't load client library
« Reply #1 on: October 27, 2015, 01:03:15 pm »
Is your app 32 or 64 bit? I suspect it's 64-bit.
When you set this property in DesignTime error does not occur.
This is because it's Lazarus that tries to use the library while in the designer. I believe your Lazarus is 32-bit.

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: UIB: can't load client library
« Reply #2 on: October 27, 2015, 04:36:35 pm »
I use a 32-bit version. How can I solve my problem?  :(
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

rvk

  • Hero Member
  • *****
  • Posts: 6910
Re: UIB: can't load client library
« Reply #3 on: October 27, 2015, 04:48:35 pm »
Why did you install Firebird 32 server on a Windows 64bit machine??

You can, without problems, install Firebird 64bit server on Windows 64bit and still access it with your 32bit Lazarus program.

But now for your problem at hand...
Do you have a WOW64 directory in C:\Program Files (x86)\Firebird\Firebird_2_5_2\ ??

In that case you'll need to do this:
Code: Pascal  [Select][+][-]
  1. const
  2.   LibName: String = 'C:\Program Files (x86)\Firebird\Firebird_2_5_2\WOW64\fbclient.dll'; // <-- this is the 32bit version
  3.  

But did this not work?
Code: Pascal  [Select][+][-]
  1. const
  2.   LibName: String = 'fbclient.dll';
  3.  
(If I remember correctly Firebird should register it's fbclient.dll so you don't have to supply a full path to it. And in that case the correct 32bit one is automatically taken from the registry for it.)


(Maybe you can even leave the whole UIBDBase.LibraryName line out)

How would you solve this if your program runs on another machine with a slightly different Firebird client/server ?? The 64bit fbclient.dll should have been copied to the C:\Windows\system32 (for 64bit) and the 32bit fbclient.dll should have been copied to C:\Windows\SysWOW64 (for 32bit) automatically during installation of Firebird.
« Last Edit: October 27, 2015, 04:56:08 pm by rvk »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8833
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: UIB: can't load client library
« Reply #4 on: October 27, 2015, 05:55:13 pm »
I use a 32-bit version. How can I solve my problem?  :(
Which one? Your app? Lazarus? Firebird client? Firebird server? The general rule is: bitness between an app and the libraries it uses must be the same.

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: UIB: can't load client library
« Reply #5 on: October 27, 2015, 06:25:29 pm »
I run several servers (such as applications) Firebird through different ports.

Previously, I used Delphi and FIBPlus and had no problems with the library customer. Fbclient. dll is able anywhere.

Now I'm beginning to think that the problem may lie in incorrect conversion of strings from UTF8 to assisting. However, this method is also not brought result
Code: Pascal  [Select][+][-]
  1. LibraryName: = UTF8toSys (LibName)
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: UIB: can't load client library
« Reply #6 on: October 27, 2015, 06:34:23 pm »
Which one? Your app? Lazarus? Firebird client? Firebird server? The general rule is: bitness between an app and the libraries it uses must be the same.
Lazarus and FB 32-bit, there are no problems with the bit,  in the registry is also no trace of FB, as the bird launched as an application

Upd:
X-m-m-m... Collected another test project with the same parameters. There are no errors.

How to rebuild this project? When you debug the LibraryName must property all the time returns "fbclient.dll"  :o
« Last Edit: October 28, 2015, 08:35:44 am by zoltanleo »
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

rvk

  • Hero Member
  • *****
  • Posts: 6910
Re: UIB: can't load client library
« Reply #7 on: October 28, 2015, 11:50:05 am »
As far as I know the default library for UIB 2.5 (is there a newer version?) is gds32.dll. When you drop a TUIBDataBase on your form you'll see it has gds32.dll as Libraryname. When you install the Firebird client you have the option to copy the fbclient.dll to C:\Windows\System32\gds32.dll (and equivelant for the 32bit version). This is done for older Interbase clients which still use gds32.dll. (for example IBX in Delphi XE has no Libraryname-setting so it uses gds32.dll as default) If you want to use fbclient.dll (in your TIUBDataBase) you can set that Libraryname to fbclient.dll.

I advise you to NOT use absolute paths. The Firebird client install should have copied a fbclient to C:\Windows\System32 and C:\Windows\SysWOW64 (check if they are there). When they are there you don't need to include absolute paths and it should work on any computer which did the default Firebird client install (and setting Libraryname to just fbclient.dll).

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: UIB: can't load client library
« Reply #8 on: October 28, 2015, 03:00:57 pm »
The name of the client library in UIB by default obviously depend on the options selected in the UIB file.inc.

Library fbclient.dll must be renamed to gds32.dll and copy the system folder only for legacy applications and middleware. But only if the FB server running as a service.

I have a FB server running as an application.

Code: Diff  [Select][+][-]
  1. fbserver -a -p 3252

So to connect to it is enough to specify the port and the client library.

As a result of experiments, I found that error accessing the library ONLY OCCURS IN THIS PROJECT. In test projects like this there is no error.

Probably the library path is saved somewhere in the project's resources, as in *.lfm files I looked.

I'll try to recreate the project again.
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

ttomas

  • Full Member
  • ***
  • Posts: 247
Re: UIB: can't load client library
« Reply #9 on: October 28, 2015, 03:36:29 pm »
Do you try to move fbclient.dll in path without space?
LibName: String = 'c:\Firebird\Firebird_2_5_2\bin\fbclient.dll';
if this pass then try
LibName: String = '"c:\Program Files (x86)\Firebird\Firebird_2_5_2\bin\fbclient.dll"';
add "path_to_fbclient.dll"

zoltanleo

  • Hero Member
  • *****
  • Posts: 509
Re: [SOLVED] UIB: can't load client library
« Reply #10 on: October 28, 2015, 04:53:42 pm »
Thank goodness!

I managed to find the cause. In the project inspector, there remained the dependence on already remote IBExpress component 

I did connect the additional thread, and the connection parameters defined in the main thread. UIB component is not thread-safe (OMG, how could I forget about it? :-[ ), so the connection parameters you want to pass into the flow explicitly.

The problem is solved. Thank you all for your participation and assistance
« Last Edit: October 29, 2015, 08:23:24 am by zoltanleo »
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

 

TinyPortal © 2005-2018