users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: Does GNU prolog compile dynamic predicates?


From: Gerald W. Shapiro
Subject: Re: Newbie: Does GNU prolog compile dynamic predicates?
Date: Fri, 21 Sep 2001 14:18:44 -0400 (EDT)

dynamic and initialization are directives. Preceed with :-, i.e.

:- dynamic(fred/1).
:- initialization(doit).

Also note that you probably need to include the cardinality of fred.

Gerald

On Fri, 21 Sep 2001, Berni Elbourn wrote:

> dynamic( fred ).
> doit:-
>         asserta( fred( 1 ) ),
>         fred( X ),
>         write( X ).
> initialization( doit ). 
> 
> Why does the compilation fial with the undefined reference?
> 
> address@hidden:~/prolog > gplc d.pl
> /usr/lib/gprolog-1.2.1/lib/libbips_pl.a(os_interf_c.o): In function 
> `Temporary_File_3':
> os_interf_c.o(.text+0x1518): the use of `tempnam' is dangerous, better use 
> `mkstemp'
> /usr/lib/gprolog-1.2.1/lib/libbips_pl.a(os_interf_c.o): In function 
> `Temporary_Name_2':
> os_interf_c.o(.text+0x1487): the use of `mktemp' is dangerous, better use 
> `mkstemp'
> /tmp/gplcgVjwX9.o: In function `predicate(doit/0)':
> /tmp/gplcgVjwX9.o(.text+0xd0): undefined reference to `predicate(fred/1)'
> collect2: ld returned 1 exit status
> compilation failed.
> 
> _______________________________________________
> Users-prolog mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/users-prolog
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]