From jan@swi.psy.uva.nl  Sat Oct 28 11:23:15 2000
Received: from gollem.swi.psy.uva.nl (gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id LAA02897;
	Sat, 28 Oct 2000 11:23:15 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id LAA05919;
	Sat, 28 Oct 2000 11:24:05 +0200
Date: Sat, 28 Oct 2000 11:24:05 +0200
Message-Id: <200010280924.LAA05919@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: Prolog question ...
To: "Nathan P. Johnson" <npjohn01@gwise.louisville.edu>
In-Reply-To: Nathan P. Johnson's message of Fri, 27 Oct 2000 16:42:28 -0400
Phone: +31 - 20 - 525 6121
Cc: prolog@gollem.swi.psy.uva.nl

> 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).=20
> The return is=20
> 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

