Hi,
I want to call a ciao module from a C++ program, and it seems that the way to do it is to use libciao.a. (Is it true?)
I tried to write a simple program using libciao.a (the code below), but running it results in "segmentation fault".
========================== #include <iostream> #include <ciao_prolog.h>
int main(int argc, char *argv[]) { ciao_term v = ciao_var(); if (ciao_is_variable(v)) printf("a variable is produced"); else printf("v is not a variable"); } ==========================
When I compile with this command :
g++ -o testciao testciao.C -L/usr/local/src/ciao-1.10p6/bin/LINUXi86 -lciao -lpthread -ldl
Compilation was successful but there was warning:
/usr/local/src/ciao-1.10p6/bin/LINUXi86/libciao.a(streams.o): In function `ENG_perror': streams.c:(.text+0x52a): warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead /usr/local/src/ciao-1.10p6/bin/LINUXi86/libciao.a(unix_utils.o): In function `prolog_unix_mktemp': unix_utils.c:(.text+0x825): warning: the use of `mktemp' is dangerous, better use `mkstemp'
Anyone can help?
Thanks, Wiratna