# How to use swipl within my C++ program?

**URL:** <https://swi-prolog.discourse.group/t/how-to-use-swipl-within-my-c-program/9620>\
**Category:** PlDoc\
**Tags:** how-to\
**Created:** [May 13, 2026, 7:56pm UTC](https://swi-prolog.discourse.group/t/how-to-use-swipl-within-my-c-program/9620 "2026-05-13T19:56:29Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [May 19, 2026, 3:51pm UTC](https://swi-prolog.discourse.group/t/how-to-use-swipl-within-my-c-program/9620/21 "2026-05-19T15:51:34Z")

</div>

> [@jan](#):
>
> If you see things that can be improved, please file a PR

I’ll add it to my “to do” list.

Also, I think that we can nowadays assume that `git clone` and `git pull` have a `--recurse` or similar option, so `git update --init --recursive` isn’t needed (although it doesn’t hurt).

---

<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:** [May 20, 2026, 6:49am UTC](https://swi-prolog.discourse.group/t/how-to-use-swipl-within-my-c-program/9620/22 "2026-05-20T06:49:23Z")

</div>

> [@peter.ludemann](#):
>
> `git clone --recursive`

is fine for the first checkout. However,

```
git pull --recurse-submodules

```

is way slower than

```
git pull
git submodule update --init --recursive

```

The reason being that it actually pulls all submodules, while the `git submodule update` only fetches the modules for which the requested hash is missing.

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [May 20, 2026, 10:20pm UTC](https://swi-prolog.discourse.group/t/how-to-use-swipl-within-my-c-program/9620/23 "2026-05-20T22:20:36Z")

</div>

```prolog
git submodule foreach 'git pull --recurse&'

```

is even faster. 🙂  
Although it does something slightly different.

[Previous page](https://swi-prolog.discourse.group/t/how-to-use-swipl-within-my-c-program/9620.md?page=1)
