Re: Executable

michel levy <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
ronan987@ hotmail.com a écrit :
> Hi. I read on GNU Prolog’s website (http://www.gprolog.org) that the 
> simplest way to obtain an executable from a Prolog source file prog.pl 
> is to use:
> 
> $ gplc prog.pl
> 
> This will produce an native executable called prog which can be executed 
> as follows:
> 
> $ prog
> 
> I did that on Linux, but after I typed in prog, nothing happened, I just 
> got the system prompt. I was wondering what I need to do to fix that. 
> Also, I’m using GNU Prolog on Windows XP and I’d like to produce an 
> executable Prolog file, how would I do that?
> 

It would be interesting to know your prog.pl

Have you a directive
:- initialization(Goal).
where Goal is the first callable_term to be executed ?
Look at the doc
http://www.gprolog.org/manual/html_node/gprolog021.html#toc38
for more information

Example :
:- initialization(creation).
creation :- randomize,sudoku_contraintes(G), tirage(0,G).


-- 
Michel Levy
L.S.R., Bureau C214, B.P.72 - 38402 SAINT MARTIN D'HERES CEDEX
e.mail : [email protected]    tel :(33)476514022
http://www-lsr.imag.fr/users/Michel.Levy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.