Re: Calling Eclipse functions from C++

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Wed 06 Jul 2005 09:49:27 AM GMT
Message-ID: <42CBA927.1070006@icparc.ic.ac.uk>
Roman Buil wrote:
> Hello,
> I don't know if I am missing anything or what is happening with my
> program.
> I am programming in C++ and I need to call Eclipse 5.8.
> 
> I have implemented a predicate for Eclipse to solve one problem and I
> need to call it from C++.
> The file where I have the predicate is called CLP_predicates and I save
> it as ".pl" and ".ecl", which extension I have to use?

Both will work, but by convention you should use .ecl for ECLiPSe
sources and .pl for plain Prolog sources (ECLiPSe is largely
backward compatible with Prolog).


 > I get an error
> when I try to compile it from C++.
> The code I am using to compile it is:
> 
> 		ec_init();
> 		post_goal("compile(CLP_predicates)");
> 		EC_resume();
> 
> And the error I get is:
> 
>  "Instantiation fault in compile(CLP_predicates) in module eclipse"

Upper-case identifiers in ECLiPSe (and Prolog) always denote
variables, therefore you will have to quote your filename if
it begins with and upper case letter. Either single quotes or
double quotes will do in this case, i.e. you have to write
either
	post_goal("compile('CLP_predicates')");
or
	post_goal("compile(\"CLP_predicates\")");


> 
> And another question is: In the section 3.4 of the "Embedding and
> Interfacing Manual" says that the ec_xt_double_arr is a predefined
> method table for arrays of doubles. How could I use it? Do I have to
> compile any other file? I can not compile my C++ program because I get
> this error:
>  
> "error C2065: 'ec_xt_double_arr' : undeclared identifier"
> 

Are you using Windows?

> 
> I think I am following the explanations of that manual mentioned before
> and the answers of my past mails.
> 
> Thank you very much,
> 
> Roman Buil
> 
> 


-- 
  Joachim Schimpf              /             phone: +44 20 7594 8187
  IC-Parc                     /      mailto:J.Schimpf@imperial.ac.uk
  Imperial College London    /    http://www.icparc.ic.ac.uk/eclipse
Received on Wed Jul 06 10:53:18 2005

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:37 PM GMT GMT