users-prolog
[Top][All Lists]
Advanced

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

Question about compiling of files lgt, pl and c++


From: CARLOS EGEA
Subject: Question about compiling of files lgt, pl and c++
Date: Fri, 14 Feb 2003 19:39:54 +0100 (CET)

I am trying to compile three types of different files
that they are.

  lgt. Logtalk Files
  pl.  Prolog Files.  
  cc.  C++ Files. 

list.lgt

:-object(list).

  :-public(length/2).
  :-public(ocurrencia/3).
  length(List,Length):-
       length(List,0,Length).
  length([],Length,Length).
  lenght([_|Tail],Acc,Length):-
        Acc2 is Acc+1,
        length(Tail,Acc2,Length).
  ocurrencia(X,Y,Z):-first_occurrence(X,Y,Z).

:-end_object.



ex.pl

s(X,Y,Z):-Z is X+Y.



examp.pl

foreign(first_occurrence(+string,+char,-positive)).



client.cc

include <string.h>
include "gprolog.h"
 
extern "C"
{
Bool
first_occurrence(char *str,long c, long *pos)
{
  char *p;
   
   p= strchr(str,c);
   if (p==NULL)
      return FALSE;

   *pos=p-str;
   return TRUE;
 }
}

When I try to compile, with the command
 gplc --c-compiler g++ list.lgt ex.pl examp.pl
client.cc

The output gives an error.


Can you help me?

Thanks in advance.

___________________________________________________
Yahoo! Móviles
Personaliza tu móvil con tu logo y melodía favorito 
en http://moviles.yahoo.es




reply via email to

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