Recent

Author Topic: Is there a way to specify the required dynamic library used by the executable?  (Read 2718 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1165
    • HowTos Considered Harmful?

I want to use sqlite as an embedded database engiine, but need to handle problems which may arise if the executable is already installed on the target computer or cannot be installed.

If the sqlite3.dll or libsqlite3.so is bundled with the program is there a way to guarantee that existing versions will not interfere with it, ie to ensure that it the one loaded by the executable?
Lazarus 3.0/FPC 3.2.2

eny

  • Hero Member
  • *****
  • Posts: 1658
I  simply always put the sqlite dll in the same folder as the executable.
No messing around with the windows folders (dont know how that works on Linux).
All posts based on: Win11; Lazarus 4_4  (x64) 12-02-2026 (unless specified otherwise...)

Fred vS

  • Hero Member
  • *****
  • Posts: 3821
    • StrumPract is the musicians best friend
Hello.

Hum, in those cases of doubt i use dynlyb.loadlib() before to call anything...

Code: [Select]
DynLibs.LoadLibrary('/dir_of/libsqlite3.so');
[EDIT] I do not know when fpc is searching for the libraries path, hope that if DynLibs.LoadLibrary() runs at begin of program, it is this one that is used.
« Last Edit: September 11, 2014, 11:52:14 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

vfclists

  • Hero Member
  • *****
  • Posts: 1165
    • HowTos Considered Harmful?
At what stage in the starting process should Dynlib.LoadLibrary be executed to avoid problems?

Is there some more documentation or experience involving its usage?
Lazarus 3.0/FPC 3.2.2

 

TinyPortal © 2005-2018