Subject: Re: [SWIPL] Prolog/C++ interface with DevStudio 6

From: Jan Wielemaker <[email-masked]>
Date: Sun, 15 Jul 2001 11:33:25 +0200

[ Please send messages as plain text; no quotedprintable, and surely
  no HTML
]

> Hi, I'm just learning how to develop with SWI-Prolog's interface to C++ =
> (SWI-cpp)and I've been having trouble compiling and running the demos. =
> I'm using Devstudio 6.0 as my development enviornment so I'm trying to =
> figure out how to get the demos compilied and running from there. So far =
> I've gotten the test program compiled and running, but it doesn't seem =
> to be working, basically I don't think it's compiling and recognizing =
> the prolog portion of the program ,because it doesn't recognize the =
> querys I enter at the command line. My problem I think is that I need to =
> use the plld program from the SWI release to build the program so that =
> it compiles in the prolog as well as the c++. Unfortunatly it seems like =
> the plld program is geared towards the gcc/g++ compiler, which is =
> obviously not the same as the Devstudio 6 compiler. My question is does =
> anyone know how to compile a prolog/c++ program from Devstudio 6 or does =
> anyone know how to use the output of plld with a devstudio project (can =
> I simply link in the output of plld as a dll???). Thanks very much..
> -Aaron

plld is works for gcc setup and MSVC, as well as for a number of other
compiler environments where configure gets the settings right.  However,
plld calls cl.exe and link.exe directly and the user is responsible for
providing the right PATH, INCLUDE and LIB environment.

But, you don't have to use plld.  Especially if you compile a DLL for
use with SWI-Prolog, simply add Prolog's lib directory to the library
directories and its include directory to the include path.  Finally
add libpl.lib to the link inputs.

Compiling embedded programs is very similar, but if you want to include
Prolog code you need to follow a couple of steps that are described with
plld as well as in the reference manual.

The reason to have plld is first of all to simplify the design of portable
makefiles combining foreign code with Prolog.  As there is nothing portable
to Devstudio anyhow this is no big issue.

	--- Jan