Subject: Re: [SWIPL] loading a foreign library for qsave_program

From: Jan Wielemaker <[email-masked]>
Date: Wed, 26 Sep 2001 16:34:47 +0200

On Mon, 13 Aug 2001, Tolga Konik wrote:
>I try to compile the following as a standby program.
>
>call_prolog_help:-
>	help.
>
>:-qsave_program(x,[toplevel(call_prolog_help)]).
>
>----------
>
>
>when it runs as stand alone, i receive the error that the library
>foreign(pl2xpce) does not exists. It seems that some of the neccessarily
>libraries are not loaded automatically. Any suggestions?

Depends a bit on the OS you are using.  Most people not mentioning
talk Windows, so lets assume that.  x.exe needs to be able to find
pl2xpce.dll and a couple more.  You achieve that in one of 4 ways:

	* Place x.exe in the Prolog `bin' folder
	* Add the Prolog `bin' folder to %PATH%
	* Copy the DLL files from the Prolog `bin' folder to the
	  Windows system directory
	* Copy the DLL files from the Prolog `bin' folder to the
	  folder containing x.exe.

The `best' solution depends on what you want to achieve.  Personally
I dislike copying things to the Windows system directory.  Doing so
in the Prolog installation would actually solve these problems, but
it makes it very messy especially if you have more than one version
around!

	Cheers --- Jan