Prolog + C
- From: none <kaizer@xxxxxxx>
- Date: Mon, 22 May 2006 22:20:30 +0100
Hello,
I am trying to link Prolog and C so I can call Prolog predicates from C code. Here's what I did and the problem that appear.
Prolog compiler is sicstus. Compiler is mingw with Code Blocks IDE.
Created a new project in Code Blocks.
Project - Build Options - Directories - "Add directory" - added the "include" directory of the prolog compiler directory.
Added the following code
#include <sicstus/sicstus.h>
int main () {
SP_pred_ref pred;
SP_qid goal;
SP_term_ref from, to;
printf ("Test");
}
Compiles ok.
The added the following code with an extra line taken from the examples
#include <sicstus/sicstus.h>
int main () {
SP_pred_ref pred;
SP_qid goal;
SP_term_ref from, to;
printf ("Test");
SP_initialize (0, NULL, NULL);
}
There are several linker errors, similar to:
..objs\main.o:main.c:(.text+0x38): undefined reference to `sp_GlobalSICStus'
Does anyone know howto do the setup?
Thanks.
.
- Follow-Ups:
- Re: Prolog + C
- From: AL .
- Re: Prolog + C
- From: Cesar Rabak
- Re: Prolog + C
- Prev by Date: like using "=..", "functor", "arg".
- Next by Date: Re: Prolog + C
- Previous by thread: like using "=..", "functor", "arg".
- Next by thread: Re: Prolog + C
- Index(es):
Relevant Pages
|
|