How to make an executable file for an XPCE program?

Hello everyone.
I’m making an user interface in XPCE for a programming school project, which has a predicate named ‘iniciar’ to initialize all the graphic elements. I tried this command:

swipl --goal=iniciar -o myprog -c interfaz.prolog

And when I run it in console, it marks this error:


ERROR: /home/user/Documents/Proyecto/Interfaz/myprog:7:1005539: Syntax error: Unexpected end of file
Warning:  /home/user/Documents/Proyecto/Interfaz/myprog:7:
Warning:    ' /home/user/Documents/Proyecto/Interfaz/myprog':7:335185: Illegal multibyte Sequence

What do I need to do?

I think you need --stand_alone=true and possibly --foreign=save.
Also, it might be better to use the directive :-initialization(iniciar) rather than --goal=iniciar (did you mean -g iniciar?)

Bit weird. Here is a minimal example:

:- use_module(library(pce)).

:- initialization(go, main).

go :-
    pce_main_loop(app).

app(_Argv) :-
    send(new(button(quit, message(@arg1?receiver?frame, destroy))), open).

Now,

swipl -o x -c pc.pl
./x

Works just fine. Can you reproduce this?

2 Likes

Thank you, it worked. :grinning: