Re: Eclipse External Language Interface (C)

From: Warwick Harvey <wh_at_icparc.ic.ac.uk>
Date: Thu 04 Jan 2001 10:41:33 AM GMT
Message-ID: <3A54535D.D36DA75C@icparc.ic.ac.uk>
Hi,

I can't immediately see why what you're doing is not working.  I
personally haven't had much experience doing this stuff under Windows,
but we do have libraries that call external C functions and work under
Windows, and they seem to be doing exactly what you're doing.

The error messages you're getting sound like what I get when I forget to
export the C function from the dynamic library.  Can you check whether
p_func is being exported properly from the DLL?  If that isn't the
problem, can you please give us more information, such as the version of
ECLiPSe you're using, which C compiler you're using, copies of sample
files which exhibit the problem, etc. so we can try to reproduce it
here?

Note also that the error message `instantiation fault in external(func /
1, _p_func)' is due to the initial underscore --- any symbol starting
with an underscore is assumed to be a variable name.  To avoid this, you
need to wrap it in single quotes: '_p_func'.  But in this case I believe
you had it right the first time with just p_func.

Cheers,
Warwick

gemichael@cytanet.com.cy wrote:
> 
> Hello,
> 
> It seems that I can't get Eclipse to call a C function. I have compiled and
> linked the C code into a .dll file, which seems to load ok using the
> "load('name.dll')" predicate. But, when I use the "external(func/1,
> p_func)" predicate, where p_func is defined as:
> 
> <<
> int p_func(value val, type tag)
> {
>         Check_Integer(tag);
>         Succeed;
> }
> >>
> 
> I get the message:
> 
> <<
> External function does not exist in external(func / 1, p_func)
> 
> *** compilation aborted
>         before line 2 in the file //E/driver.pl
> calling an undefined procedure end_of_file in module eclipse
> >>
> 
> I tried to use "external(func/1, _p_func)" instead, but only to get a
> different message:
> 
> <<
> instantiation fault in external(func / 1, _p_func)
> 
> *** compilation aborted
>         before line 2 in the file //E/driver.pl
> >>
> 
> I also tried enclosing p_func and _p_func in double quotes, but the problem
> persists.
> 
> Am I doing something wrong, or forgetting something? I searched the
> documentation, as well as the Internet, but I haven't been successful in
> finding anything.
> 
> I would be greatly obliged if you could assist me with this problem.
> 
> Many thanks,
> 
> Loizos Michael
Received on Thu Jan 04 10:41:34 2001

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:02 PM GMT GMT