Subject: Re: Can't execute saved state

From: Jan Wielemaker <[email-masked]>
Date: Thu, 15 Jun 2000 12:39:26 +0200

> I have upgraded my SWI-Prolog compiler to the 3.3.7 and I 
> can't execute saved state programs anymore. OS is Windows 
> NT 4.0.
> Compilation is alright, but when I try to execute the .exe 
> file, I have a
> SWI-Prolog: [FATAL ERROR:
>         loadPart(): QLF format error at index =3d 108]
> error message.
> Now, even reinstalling SWI-Prolog 3.3.6 doesn't allow me to 
> execute the exe file and I had to switch back to 3.3.2 to 
> be able to create saved state and then execute the 
> resulting .exe file.
> I have uninstalled all the Prolog engine and removed the 
> registry entries to install again SWI 3.3.7 from the 
> scratch, but I still have the same result.
> I'm creating the saved state with:
> plcon -O -o plweb.exe -t halt -g go -c plweb6.pl
> 
> Does anyone have an idea or encounter the same problem?

It should be noted that a saved state consists of plcon.exe (in this
case), followed by the state.  plcon.exe loads libpl.dll, the Prolog
kernel.  It does so using normal Windows behaviour, which means first
in the directory of the .exe, then in %PATH%, then in the Windows
directory.

The most likely cause is that your plweb.exe finds libpl.dll over %PATH%
and picks up the vesion of 3.3.2.  As the save-state format has changed,
this fails.

One day this should be fixed properly. The libpl.dll is rather unstable
in its interfaces: the saved-state format changes regulary, as does the
interface between Prolog defined system predicates and C-defined
internal predicates and finally, the virtual machine instructions
sometimes change.

Best might be to call these things pl337.dll, etc.  If there is someone
around who knows how I can parameterize this is MSVC projects (i.e.
changing it in one place, not at least 6), please let me know.

If the diagnosis proves wrong, please send the program, or another small
program demonstrating the problem.

	Regards --- Jan