Skip to content

sei-mwd/packages-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

139 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWI-Prolog C++ interface

Embedding SWI-Prolog in a C++ program

The files likes.pl and likes.cpp provide a simple example emedding SWI-Prolog. To compile, run

swipl-ld -o likes likes.cpp likes.pl

Next, run as e.g.

./likes john
./likes -happy

Extending SWI-Prolog using C++ code

The files test.pl and test.cpp add foreign predicates to SWI-Prolog. To compile, run

swipl-ld -o test -shared test.cpp

Next, run as e.g.

swipl test.pl
?- hello(world).
Hello world
true.

About

The SWI-Prolog C++ interface

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 97.4%
  • Prolog 1.7%
  • CMake 0.9%