users-prolog
[Top][All Lists]
Advanced

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

Re: Segfault in Mk_Proper_List


From: Erick Alphonse
Subject: Re: Segfault in Mk_Proper_List
Date: Sun, 20 Oct 2002 13:34:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

Hi Olivier

> I get a segmentation fault when I call Mk_Proper_List from C, and I
> can't find what's wrong with my program (I'm using gprolog 1.2.16).
> Here is the listing, reduced to the minimum:
>
> #include "gprolog.h"
>
> int main_wrapper( int argc, char *argv[] )
> {
>     int i;
>     PlTerm elements[8];
>     PlTerm list;
>     for( i = 0; i < 8; i++ )
>     {
>         elements[i] = Mk_Integer( i );
>     }
>     list = Mk_Proper_List( 8, elements );
>     return 0;
> }

Mk_Proper_list creates the term representation in the prolog stack. You need to Start_Prolog(argc, argv); somewhere before creating terms.

Cheers,
Erick.





reply via email to

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