Subject: Re: DLL loading problem with plcon

From: Lionel Ains <[email-masked]>
Date: Wed, 9 Aug 2000 14:11:18 +0100 (WET DST)

> -------Message d'origine-------
> De : Jan Wielemaker <[email-masked]>
> Date : 09/08/100 13:09:17
> 
> On Tue, 08 Aug 2000, Lionel Ains wrote:
> >
> >OK, here is the command-line:
> >
> > "C:\Program Files\SWI-Prolog\bin\plcon" -g "load_files(['prog']), write_ln('Program
> >loaded'), qsave_program('prog.exe', [goal=go, toplevel=none, stand_alone=true]), 
write_ln('Program
> >Successfully saved')" -t halt.
> 
> Well, it is a bit complicated. First of all, toplevel=none isn't a
> good idea. It will make Prolog call none/0 as toplevel. If you don't
> want a toplevel use halt/0.
> 
> Generally a better idea is to do
> 
> go :-
> 	
> 	halt.
> 
> and don't change the toplevel. That way you can use Control-C and
> break for (some) debugging. If you don't want the user doing this,
> toplevel=halt is indeed a way to prevent it.
> 
> To create executables, just do
> 
> 	plcon -g go -o myprog -c prog.pl
> 
> which will create myprog(.exe on Windows).
> 
> 	Regards --- Jan
You're perfectly right, it's quite complicated but I've switched back to this command line compilation 
after having problems with plcon.exe. I was using the "plcon -o" command line as well before having 
problems with DLL loading.
In fact, I've realised that plcon was not crashing but simply not outputting messages anymore.
After loading the foreign language library, no prompt, nor even compilation message is printed 
anymore. Prolog is still running but all its output is muted.
However, I can get all the messages when I redirect the output to a file on plcon's command-line.
This must be the reason why I don't have any problem with plwin.exe because I guess that the output 
to the Window is handled a different way.
Would there be a few Prolog environment variables that I could check to be sure that the output is set 
correctly?

> P.s.	Is the problem loading your dll into the interactive plcon
> 	resolved. It should not make any difference. So if the
> 	problem remains, please send me the stuff needed to reproduce
> 	it.
If you want, I can send the DLL file directly to you, and the C source code for the Prolog foreign 
language interface as well.

> P.s.s.	If you think your interface is useful for others, please
> 	consider providing it as a SWI-Prolog package.
If I can manage to fix all the problems and clean the code, I will send you the code for this interface. I 
have to check the license with the owners of the Grammar Language Parser to see if I can do so.
A new release of the Link Grammar Parser has be finished (v4.0). This allow users to parse the 
grammar links contained by a sentence in English. For more information, have a look at 
http://bobo.link.cs.cmu.edu/index.html/ .
This parser is quite powerful and efficient, and the interface I'm currently developping allows Prolog to 
parse any sentence by using the Link Grammar Parser library. The grammar link structure is then 
returned as a Prolog term containing the link structure.
I will let you know about the progress of this work.

Lionel
______________________________________________________
Boîte aux lettres - Caramail - http://www.caramail.com