[fpc-pascal] loadlibrary() unsafe ?

fredvs fiens at hotmail.com
Wed Jun 10 13:20:45 CEST 2015


Hello.

Here the thing: a open-source program, eSpeak (voice synthezer) uses 2
libraries: espeak-library and portaudio.

In eSpeak source =>

- For the Windows version, the libraries are included in the executable
(static linked).
  To do run the program => it is easy => just run the executable via
TProcess (espeak.exe).

- For Linux, the eSpeak source produces a executable with static
espeak-library included but without static portaudio-library included in
executable.
  So portaudio library must be installed in library path of the system.
  If portaudio is not installed in library path of the system, a trick that
works is:

  To do run the program => 
  - first dynamic load portaudio with
loadlibrary('/the_path_you_want/libportaudio.so').
  - run the executable via TProcess (espeak).

- For freeBSD, the eSpeak source produces a executable without static
espeak-library nor static portaudio-library included in executable.
  So both espeak-library and portaudio-library must be installed in library
path of the system.
  If libraries are not installed in library path of the system, a trick that
works is:

  To do run the program => 
  - first dynamic load portaudio with
loadlibrary('/the_path_you_want/libportaudio.so').
  - then dynamic load libespeak with
loadlibrary('/the_path_you_want/libespeak.so').
  - run the executable via TProcess (speak).

All is working like charms.

Now i heard that this trick is unsafe.

Why ?

Many thanks.

Fre;D




-----
Many thanks ;-)
--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/loadlibrary-unsafe-tp5721801.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list