'SWI-Prolog stand alone executable

I am trying to create an windows SWI-Prolog executable. I have created the desired executable using this command line argument.

  • --goal=main --stand_alone=true -o myprog -c file.pl

but when I try and run the executable it flashes for a second then goes away. I was looking at the documentation that swi-prolog has on this area and it said that I need to have these dlls.

  • libgcc_s_seh-1.dll
  • libgmp-10.dll
  • libswipl.dll
  • libwinpthread-1.dll
  • zlib1.dll

I have located them in the bin folder, but I am confused at how I get my prolog program to load the dlls. I have read up on the predicate use_foreign_library/1:

use_foreign_library(FileSpec) :- 506 ensure_shlib, 507 initialization(shlib:load_foreign_library(FileSpec), now)

but after reading about it I am still confused as to how to use this predicate or if this predicate will help me solve my problem.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source