# Interfacing Prolog to C++

**URL:** <https://swi-prolog.discourse.group/t/interfacing-prolog-to-c/3277>\
**Category:** Help!\
**Tags:** how-to\
**Created:** [November 19, 2020, 2:43am UTC](https://swi-prolog.discourse.group/t/interfacing-prolog-to-c/3277 "2020-11-19T02:43:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fpcarv](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@fpcarv](https://swi-prolog.discourse.group/u/fpcarv)\
**Post date:** [November 19, 2020, 2:43am UTC](https://swi-prolog.discourse.group/t/interfacing-prolog-to-c/3277/1 "2020-11-19T02:43:32Z")

</div>

Hi Everyone!

I know that before asking questions … RTFM … and so I did 😉

> **[section('packages/pl2cpp.html')](https://www.swi-prolog.org/pldoc/doc_for?object=section%28%27packages%2Fpl2cpp.html%27%29)**

However, I could find a(some?) full example(s), mentioning the libraries and the include files (C++ part) and the modifications to do to SWI to allow it to be called from C++ (and vice-versa)

Have I lost anything? Is this information someplace else?

Many thanks for your help!

-Francisco

---

<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:** [November 19, 2020, 8:00am UTC](https://swi-prolog.discourse.group/t/interfacing-prolog-to-c/3277/2 "2020-11-19T08:00:29Z")

</div>

The include file is `SWI-cpp.h` and you have to link to `libswipl`. How to do the latter depends on the platform.
