Calling Prolog predicates from a C program.
- From: "Sujai" <sujai_antony2001@xxxxxxxxx>
- Date: 30 Jan 2006 07:31:05 -0800
Hi all,
I would like to have a standalone executable that makes prolog queries
and prints out the results. Here is my implementation.
/* Start*/
#include"SWI-Prolog.h"
main(int argc,char **argv)
{
if ( !PL_initialise(argc, argv) )
PL_halt(1);
static predicate_t pred_id;
term_t t0=PL_new_term_refs(4);
pred_id=PL_predicate("my_getdata",4,"getdata");
PL_call_predicate(NULL,PL_Q_NORMAL,pred_id,t0);
}
/* End*/
I am trying to compile this program using the following command.
'plld temp.c -L .'
On doing this, I am getting the following error:
temp.o(.text+0x1a): In function `main':
: undefined reference to `PL_initialise'
temp.o(.text+0x2b): In function `main':
: undefined reference to `PL_halt'
temp.o(.text+0x38): In function `main':
: undefined reference to `PL_new_term_refs'
temp.o(.text+0x52): In function `main':
: undefined reference to `PL_predicate'
temp.o(.text+0x6c): In function `main':
: undefined reference to `PL_call_predicate'
collect2: ld returned 1 exit status
gcc returned code 256
*** plld exit status 1
The libpl.a is in the same directory as the file temp.c
Can someone help me in resolving the linker errors above.
Thanks in advance.
Sujai.
.
- Follow-Ups:
- Re: Calling Prolog predicates from a C program.
- From: Jan Wielemaker
- Re: Calling Prolog predicates from a C program.
- Prev by Date: ACM PPDP 2006 call for paper
- Next by Date: Re: Calling Prolog predicates from a C program.
- Previous by thread: ACM PPDP 2006 call for paper
- Next by thread: Re: Calling Prolog predicates from a C program.
- Index(es):
Relevant Pages
|
|