Subject: Re: [SWIPL] foreign library

From: Jan Wielemaker <[email-masked]>
Date: Mon, 17 Dec 2001 16:17:53 +0100

On Sun, 16 Dec 2001, Ioannis Partsakoulakis wrote:
>I have deifned a C++ method like the following
>
>PREDICATE(iniagent,0) {
>    ...
>}
>
>and have created a dll file. I can load this dll from a prolog file called
>ica.pl by adding
>
>:-load_foreign_library('c:/icagent/debug/icai.dll').
>
>and all goes fine when I call iniagent method from prolog.
>
>I saved the ica.pl as a qlf file and now I want to make a new C++ file that
>loads ica.qlf and calls the iniagent predicate. However, when I call
>predicate iniagent from the C++ file I get the message "Undefined procedure
>iniagent/0".

It isn't completely clear what you (try to) do.  Some things to look at:

	* If you want directives to work in states, make sure to tag
	  them using initialization:

	  :- initialization load_foreign_library(...).

	* Are there module problems?

	* Are there any error messages or warnings?

If this doesn't fix it, try to compile a small suite of files
demonstrating the problems, so we don't have to guess on the
(often important) details of your setup.

	--- Jan