# Swipl.rc and swipl-win.rc

**URL:** <https://swi-prolog.discourse.group/t/swipl-rc-and-swipl-win-rc/6124>\
**Category:** General\
**Created:** [January 24, 2023, 8:51am UTC](https://swi-prolog.discourse.group/t/swipl-rc-and-swipl-win-rc/6124 "2023-01-24T08:51:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [January 24, 2023, 8:51am UTC](https://swi-prolog.discourse.group/t/swipl-rc-and-swipl-win-rc/6124/1 "2023-01-24T08:51:52Z")

</div>

Dear Jan, dear others,

Greetings from MSYS! I think I have a few minor path issues, and maybe you could give me a bit of guidance. After installation, I get errors in test\_xpce, saying that use\_module(library(pce)) fails. I can work around this by the steps below, basically loading swipl-win.rc. Note that I don’t seem to have swipl.rc.

I guess swipl.rc and swipl-win.rc belong to swipl.exe and swipl-win.exe, respectively, but swipl-win.exe is actually disabled during cmake. So I end up with swipl.exe and swipl-win.rc, which is probably not indended.

Is my conclusion correct?

Best wishes,

Matthias

```prolog
Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ ~/swipl/bin/swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.1.3-40-gc92083831-DIRTY)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

1 ?- use_module(swi('swipl-win.rc')).
true.

2 ?- use_module(library(pce)).
true.

3 ?- use_module("c:/msys64/home/matthias/swipl/lib/swipl/test/packages/xpce/test_xpce.pl")
.
XPCE/SWI-Prolog test suite. (XPCE version 6.6.66, July 2009)
To run all tests run ?- test.

true.

4 ?- test_xpce.
Running test set "name" . done.
Running test set "wname" ... done.
Running test set "fmt" ...... done.
Running test set "srcsink" .. done.
Running test set "file" .... done.
Running test set "unicode_file" .. done.
Running test set "dir" ..... done.
Running test set "unicode_dir" ... done.
Running test set "bom" . done.
Running test set "plterm" . done.
Running test set "real" ... done.
Running test set "textbuffer" .... done.
Running test set "asfile" .... done.
Running test set "selection" .. done.
Running test set "image" . done.
Running test set "regex" ...................... done.
Running test set "type" .. done.

All tests passed
true.

10 ?- use_module(swi('swipl.rc')).
ERROR: source_sink `swi('swipl.rc')' does not exist

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [January 24, 2023, 9:35am UTC](https://swi-prolog.discourse.group/t/swipl-rc-and-swipl-win-rc/6124/2 "2023-01-24T09:35:59Z")

</div>

> [@mgondan1](#):
>
> I guess swipl.rc and swipl-win.rc belong to swipl.exe and swipl-win.exe, respectively, but swipl-win.exe is actually disabled during cmake. So I end up with swipl.exe and swipl-win.rc, which is probably not indended.

swipl-win.exe comes from two places. From `packages/swipl-win` we get a version based on the portable Qt framework. On Windows we get `swipl-win.exe` from the main source (inplemented by `src/win32/console`). That should still be there, no?

An executable loads the `.rc` file based on the name of the binary. Historically, the console application could not support graphics and the whole purpose of `swipl-win.rc` is to link xpce into Prolog. This has changed, notably because xpce now by default runs in its own thread and therefore we no longer have to combine the Windows message loop and console input in one thread. You can try using

```prolog
swipl.exe
?- [swi('swipl-win.rc')].
?- emacs.

```

On the normal Windows binary this seems to work (only tested some basics).

We could consider installing `swipl.rc` along with `swipl-win.rc` (they should be the same). It might give some issues for people creating saved states from `swipl.exe` as these have the tendency to include xpce unless started using `swipl --no-pce` or `swipl -F none` to stop loading the init file.

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [January 24, 2023, 11:47am UTC](https://swi-prolog.discourse.group/t/swipl-rc-and-swipl-win-rc/6124/3 "2023-01-24T11:47:58Z")

</div>

```prolog
swipl.exe
?- [swi('swipl-win.rc')].
?- emacs.

```

Yes, works here as well (under MSYS2). Nice!

> [@jan](#):
>
> It might give some issues for people creating saved states from `swipl.exe` as these have the tendency to include xpce unless started using `swipl --no-pce` or `swipl -F none` to stop loading the init file.

Yes—on the other hand, wouldn’t it be my own responsibility whether to install swipl with xpce support or not? I may not get the problem here, and what I am actually trying is do is only to get “test\_installation” running on MSYS2.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [January 24, 2023, 12:11pm UTC](https://swi-prolog.discourse.group/t/swipl-rc-and-swipl-win-rc/6124/4 "2023-01-24T12:11:32Z")

</div>

> [@mgondan1](#):
>
> Yes—on the other hand, wouldn’t it be my own responsibility whether to install swipl with xpce support or not?

The packager typically decides on that 🙂

> [@mgondan1](#):
>
> what I am actually trying is do is only to get “test\_installation” running on MSYS2.

That can also be done using this around

```prolog
:- if(exists_source(library(pce))).

```

Pushed a fix this way. That still allows for installing `swipl.rc`, but prevents the test from failing if the test executable does not have xpce enabled.

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [January 24, 2023, 1:21pm UTC](https://swi-prolog.discourse.group/t/swipl-rc-and-swipl-win-rc/6124/5 "2023-01-24T13:21:48Z")

</div>

> [@jan](#):
>
> The packager typically decides on that 🙂

It’s on the list, but does not have priority right now.
