Recent

Author Topic: SOLVED Need help for Dynamic load of a library  (Read 10060 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3413
    • StrumPract is the musicians best friend
SOLVED Need help for Dynamic load of a library
« on: July 12, 2010, 02:40:41 pm »
Hello everybody.
I have a big problem and cant find the solution.
I have developed a DJ prog, with Lazarus of course. (http://sites.google.com/site/fiensprototyping/home)
It uses a audio library : Bass (http://www.un4seen.com/).
To load that library i use a dynamic loading, with Lazdynamic_bass.pas.

It works perfectly.

Now it exists some plugging libraries like Bass_fx who use them self the Bass library.
And i cant load them dynamically like the main Bass library.
Any idea how to do this ?
Thanks
« Last Edit: July 15, 2010, 04:38:36 pm by fredvs »
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

Fred vS

  • Hero Member
  • *****
  • Posts: 3413
    • StrumPract is the musicians best friend
Re: Need help for Dynamic load of a library
« Reply #1 on: July 12, 2010, 03:14:14 pm »
Here some explanations.

See in attachment :
Lazdynamic_bass.pas that load dynamic the Bass library, it is what i use and it works perfectly.
and bass_fx.pas who load the Bass_fx library as usual, not dynamic.

What must i change in Bass_fx.pas to load bass_fx lib dynamic ?

If i change in Bass_fx.pas in the use section:
lazdynamic_bass in place of bass it does not work.

The original header for bass is bass.pas who dont load bass lib dynamic.

Thanks
« Last Edit: July 12, 2010, 03:57:02 pm by fredvs »
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

Fred vS

  • Hero Member
  • *****
  • Posts: 3413
    • StrumPract is the musicians best friend
Re: Need help for Dynamic load of a library
« Reply #2 on: July 13, 2010, 03:14:26 pm »
Toc, toc, toc is anybody there ?
Thanks
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

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11944
  • FPC developer.
Re: Need help for Dynamic load of a library
« Reply #3 on: July 14, 2010, 01:48:04 pm »
 
 lazdynamic_bass in place of bass it does not work.

What doesn't work where how and for who? Be descriptive

Also see if there are $linklib bass in bassfx, and remove them.

Fred vS

  • Hero Member
  • *****
  • Posts: 3413
    • StrumPract is the musicians best friend
Re: Need help for Dynamic load of a library
« Reply #4 on: July 14, 2010, 06:06:25 pm »
Hi marcov and thanks for your attention.

In attachment there is a dynamic loader of bass_fx that i try to develop.

I can compile a prog when i use that lazdynamic_bass_fx.pas, no error message but if i try to use a procedure of that header i get a external sigsegv error message.

What is wrong in my code ?

Thanks for help
« Last Edit: July 14, 2010, 06:11:40 pm by fredvs »
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

Fred vS

  • Hero Member
  • *****
  • Posts: 3413
    • StrumPract is the musicians best friend
SOLVED Re: Need help for Dynamic load of a library
« Reply #5 on: July 14, 2010, 08:19:06 pm »
Re-hello to everybody.

I have tried Lazdynamic_bass_fx.pas under windows and there it works perfectly, the library load like a charm.

If i compile the same code under Linux, the library dont load.
And the library libbass_fx.so works under Linux but only if i put it in /lib or /usr/lib.

Why can i not load dynamic that library under Linux ?

SOLVED The code is OK, maybe some prob with library libbass_fx.so ...
« Last Edit: July 15, 2010, 04:37:04 pm by fredvs »
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

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11944
  • FPC developer.
Re: SOLVED Re: Need help for Dynamic load of a library
« Reply #6 on: July 20, 2010, 11:35:37 am »

And the library libbass_fx.so works under Linux but only if i put it in /lib or /usr/lib.

This is normal, .so's standardly only load from system directories under Linux and unices.

Fred vS

  • Hero Member
  • *****
  • Posts: 3413
    • StrumPract is the musicians best friend
Re: SOLVED Need help for Dynamic load of a library
« Reply #7 on: July 21, 2010, 08:20:37 pm »
Hi Marcov.

That is just the goal of a dynamic loading !  ;D
With a dynamic load you can choose the location of a .so lib.

With Lazdynamic_Bass.pas you can choose the location of libbass.so and load it, in Linux and in Windows as well (bass.dll).

With  Lazdynamic_FX_Bass.pas  (that i have translated from Bass_FX.pas, following the ideas of Lazdynamic_Bass.pas for Bass.pas) it does not dynamic-load libbass_fx.so lib in Linux.
But in Windows, bass_fx.dll dynamic-load without problems with the same code lazdynamic_Bass_FX.pas.

And the question was : why ?
Whats wrong in code Lazdynamic_FX_Bass.pas ?
(Knowing that Lazdynamic__Bass.pas works perfectly in Linux as well and was translated from Bass.pas)

 ;)
Thanks
« Last Edit: July 21, 2010, 09:02:36 pm by fredvs »
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

 

TinyPortal © 2005-2018