[fpc-pascal] loadlibrary() unsafe ?

Fred van Stappen fiens at hotmail.com
Wed Jun 10 13:33:59 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
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150610/fa5051ac/attachment.html>


More information about the fpc-pascal mailing list