users-prolog
[Top][All Lists]
Advanced

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

question and bug report for gprolog 1.2.14


From: Erick Alphonse
Subject: question and bug report for gprolog 1.2.14
Date: Mon, 09 Sep 2002 13:32:13 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

Hello,

We cannot use the following directive in gprolog as in other prologs:
:- write(sdf).

instead we have to use initialization/1. Is the first version not ISO supported? If not I think it could be nice to support user directives (just a wish ;)).

Also, I face 3 problems with gprolog 1.2.14:

1) I cannot link external predicates written C++ and gprolog 1.2.14 under Mandrakelinux 8.2 (and I can with gprolog 1.2.9 or when rewriting the external predicates in C). Does someone experience the same problem?

test.pl
:- foreign(pred1(+term),[return(boolean)]).
:- foreign(pred2(+term),[return(boolean)]).

pred1.cpp
#include "gprolog.h"

extern "C"
int pred1(PlTerm p) {
  return true;
}

pred2.cpp
#include "gprolog.h"

extern "C"
int pred2(PlTerm p) {
  return true;
}

1022# gplc --c-compiler g++ -L '-lstdc++' test.pl pred1.cpp pred2.cpp -o test
/tmp/gplcL3hnec.o(.bss+0x0): multiple definition of `last_read_line'
/tmp/gplcRxTy6a.o(.bss+0x0): first defined here
/tmp/gplcL3hnec.o(.bss+0x4): multiple definition of `last_read_col'
/tmp/gplcRxTy6a.o(.bss+0x4): first defined here
/tmp/gplcL3hnec.o(.bss+0x8): multiple definition of `byte_code'
/tmp/gplcRxTy6a.o(.bss+0x8): first defined here
collect2: ld returned 1 exit status
compilation failed

I use the compiler gcc version 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk).

2) I get a segmentation violation with term_ref:
GNU Prolog 1.2.14
By Daniel Diaz
Copyright (C) 1999-2002 Daniel Diaz
| ?- term_ref(X,12).

Fatal Error: Segmentation Violation

3) ensure_linked(Pred) links not only Pred but all predicates defined in the same file.

Thanks in advance for any feedback,
Best regards,
Erick.





reply via email to

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