From jan@swi.psy.uva.nl Sun Jul 15 11:33:26 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f6F9XPX26367;
	Sun, 15 Jul 2001 11:33:26 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f6F9XPS20646;
	Sun, 15 Jul 2001 11:33:25 +0200
Date: Sun, 15 Jul 2001 11:33:25 +0200
Message-Id: <200107150933.f6F9XPS20646@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] Prolog/C++ interface with DevStudio 6
To: "Aaron St.John" <astjohn@mediaone.net>, <prolog@swi.psy.uva.nl>
In-Reply-To: Aaron St.John's message of Fri, 13 Jul 2001 05:30:30 -0400
Phone: +31 - 20 - 525 6121

[ 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

