|Did you know ...||Search Documentation:|
|Compilation using the -c command line option|
This mechanism loads a series of Prolog source files and then creates a saved state as qsave_program/2 does. The command syntax is:
% swipl [option ...] [-o output] -c file.pl ...
The options argument are options to qsave_program/2 written in the format below. The option names and their values are described with qsave_program/2.
For example, to create a stand-alone executable that starts by
executing main/0 and for which the source is loaded through
load.pl, use the command
% swipl --goal=main --stand_alone=true -o myprog -c load.pl
This performs exactly the same as executing
% swipl <banner> ?- [load]. ?- qsave_program(myprog, [ goal(main), stand_alone(true) ]). ?- halt.