From jan@swi.psy.uva.nl  Thu Jun 15 12:38:41 2000
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id MAA29955;
	Thu, 15 Jun 2000 12:38:41 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id MAA20129;
	Thu, 15 Jun 2000 12:39:26 +0200
Date: Thu, 15 Jun 2000 12:39:26 +0200
Message-Id: <200006151039.MAA20129@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: Can't execute saved state
To: Lionel Ains <lains@caramail.com>, prolog@swi.psy.uva.nl
In-Reply-To: Lionel Ains's message of Thu, 15 Jun 2000 11:39:40 GMT+1
Phone: +31 - 20 - 525 6121

> 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

