Subject: Re: Prolog question ...

From: Jan Wielemaker <[email-masked]>
Date: Sat, 28 Oct 2000 11:24:05 +0200

> Jan:
> 
> I am the system admin. at the University of Louisville. A grad student is > trying to link a shared library (written in c), load it into prolog and > then call the c functions from it.
> 
> I have followed your instructions in the SWI-Prolog Reference. The load > foreign library part returns a yes, but no matter what course I have > tried, I always get an error "Undefined procedure."
> 
> If i load the lowercase library and then call lowercase('Hello',L). 
> The return is 
> ERROR: Undefined procedure.
> 
> I am compiling on AIX 4.3.x.
> 
> Any ideas?

AIX always used to be a hard nut, though I understood they are
nowadays using ELF binaries, is that correct?  If they still use the
AIX COFF binaries I don't know whether loading as shared object works.
It has worked long ago on some AIX version with some C-compiler and
linker, but in the current versions!?

Try using the C-debugger to see whether it was really added to the
image (in gdb using the command `shared').  Could it be the install
function has a leading underscore?  Try ?- load_foreign_library(file,
function).

If all fails, try embedding using plld or provide me with a guest login
and I will have a look.

	Regards --- Jan