login

editBuilding SWI-Prolog on MS-Windows

There are only a few cases where you would like to build the Windows version from source:

As of the integrated XPCE/SWI-Prolog 4.0.0, the installation is no longer based on MSVC project files that are simply too hard to maintain if building involves many custom steps. Instead, there are makefiles for NMAKE that run from a command window.

Before starting the build, you'll need:

  1. Will be downloaded automatically from the SWI-Prolog web-site in the procedure outlined below.
  2. Optional.

Now proceed as follows:

Thats all. You can now start plwin.exe or plcon.exe from the $(prefix)\pl\bin\ directory. If you want you can associate .pl with plwin.exe and/or add plwin.exe to your start menu. Cleanup After installing you may discard the entire source-tree or invoke one of the targets below to clean the object files or all generated files

nmake /f makefile.mak clean
nmake /f makefile.mak distclean

Compile for debugging

To compile SWI-Prolog for debugging, use a clean source-tree (using nmake /f makefile.mak clean), build and install SWI-Prolog using

nmake DBG=true /f makefile.mak
nmake DBG=true /f makefile.mak install

Using your own library or libraries:

The script will ask you whether you would like to supply your own versions of the libraries and override some or all of the libraries in the downloaded pre-requisites package.

In this case the script will create $(prefix)\pl\X86 (32bit) and/or $(prefix)\pl\X64 (64bit) directories, sub-directories include/lib will equally be created.

Place the libraries and/or header files in the appropriate include or lib folder. These versions will now override the ones in the download package.

See also
- Build using MinGW