Re: Possible to integrate latest SWI-Prolog with Visual Studio 2010?
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
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]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>