I have a weird problem with SWI Prolog 6.2.0 and XPCE on Unix.
When I run a prolog program, it works perfectly fine.
swipl -f file.pl
However, whenever I try and compile the same program
swipl -o launch -c file.pl
I get an error telling me that pce library is not available
source_sink `library(pce)' does not exist
I am completely lost as for what could be the reason . . .
I've tried to compile colour.pl
, a sample from XPCE manual, and I found the same problem you report. Seems that's mandatory to specify the XPCE library path.
I was able to compile with
swipl -p library=~/lib/swipl-6.1.13/xpce/prolog/lib/ -o colour -c colour.pl
Obtaining the library path is not immediate: the easy way I found: open the source of your file, at line of the first error message (should be something like :- use_module(library(pce)).
) with the IDE.
Then with the right mouse button open the library source, and from menu File
click Save as...
, the box will show the path you can use to compile.
HTH