Re: Possible to integrate latest SWI-Prolog with Visual Studio 2010?

Kaitain Jones <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAMeycMxaRztF9OXTMCcMYU9ikTt7jOaiv4+k+HG3HLRQVN84-A@mail.gmail.com>
Hi Jan, thanks for the reply.

To take a step back from this specific problem, I am hoping to use a
declarative system embedded into a (mainly C++) application that is
ultimately intended to be deployed on a wide variety of platforms including
Windows, Mac, Linux, iOS and Android.

Prolog would be my first choice, and SWI would be my first choice for
Prolog, but I'm trying to figure out whether this plan A is feasible or
whether it's unlikely to work. (I'm considering other options such as
Castor and CLIPS as well as rival Prolog implementations.) I am assuming
that the SWI option, if it will work at all, will require building static
libs from source. Do you have any instinct/advice as to whether SWI will be
a viable option given my cross-platform needs?

Thanks again,

KJ


On Tue, Oct 8, 2013 at 2:38 AM, Jan Wielemaker <[email protected]> wrote:

> On 10/08/2013 03:22 AM, Kaitain Jones wrote:
>
>> Am attempting to do this, but almost all instructions I've found online
>> are
>> based around older versions of SWIPL with a libpl.lib library to which the
>> linker should be pointed. The current version of SWI (Windows, 64-bit) has
>> instead libswipl.dll.a.
>>
>> I read a thread here from last year in which Alan Baljeu suggested simply
>> renaming the dll file to be libswipl.lib, and that this had worked in his
>> particular case. I tried this, and I still get a link error:
>>
>
> I think this works for 32-bit, but not for 64-bit.  You'll have to dig
> into the documentation how to use MinGW-64 generated DLLs with MSVC.
> If someone can sort this out, I'm happy to provide .lib files next
> to the .dll.a files.  Ideally, I'd like patches to the Makefiles or
> installation generation scripts, but clear instructions for generating
> MSVC compatible .lib files is fine too.
>
>         Cheers --- Jan
>
>
>  *1>VSProject.obj : error LNK2019: unresolved external symbol
>> _PL_initialise
>> referenced in function _wmain*
>> *1>C:\[...]\VSProject\Debug\**VSProject.exe : fatal error LNK1120: 1
>> unresolved externals*
>>
>>
>>
>> The C code is simply trying to initialize Prolog and do no more than that
>> for now:
>>
>> *#include "stdafx.h"*
>> *
>> *
>> *#include <iostream>*
>> *#include <SWI-Prolog.h>*
>> *
>> *
>> *using namespace std;*
>> *
>> *
>> *int _tmain(int argc, _TCHAR* argv[])*
>> *{*
>> *
>> *
>> * static char * av[] = {"libswipl.dll", NULL};*
>> * if( ! PL_initialise(1,av)){*
>> * cout<<"error initializing"<<endl;*
>> * }else {*
>> * cout<<"success initializing!"<<endl;*
>> * }*
>> * return 0;*
>> *}*
>>
>>
>> I added the* /swipl/include* path as an include directory in
>> *C++->General*,
>> and added* C:\Program Files\swipl\lib\libswipl.lib* as an Additional
>> Dependency in* Linker->General*.
>>
>>
>> But the link behaves no differently from how it would if there were no
>> libswipl.lib at all.
>>
>> Should I expect this to work in principle? Are additional steps needed?
>> Has
>> anybody got SWI working recently with Visual Studio?
>>
>> Many thanks,
>>
>> KJ
>> -------------- next part --------------
>> HTML attachment scrubbed and removed
>> ______________________________**_________________
>> SWI-Prolog mailing list
>> [email protected].**de <[email protected]>
>> https://lists.iai.uni-bonn.de/**mailman/listinfo.cgi/swi-**prolog<https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog>
>>
>>
>
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.