[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem interfacing prolog and C
From: |
Erick Alphonse |
Subject: |
problem interfacing prolog and C |
Date: |
Sat, 04 Dec 2004 11:00:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 |
Hello,
I would like to call prolog from C, but I can't even get it working on
this very simple example:
% test.pl
:- initialization(top).
:- foreign(write_c(+term),[return(none)]).
top :-
write_c(a).
% test_c.c
#include "gprolog.h"
void write_c(PlTerm In) {
Create_Atom("writeq");
}
I compile with (under 1.2.18 or 1.2.16) : gplc test_c.c test.pl -o test
and I get a Fatal Error: Segmentation Violation.
Could someone explain to me what is wrong please?
Thanks a lot in advance for helping me out,
Regards,
Erick.
- problem interfacing prolog and C,
Erick Alphonse <=