C # interface prolog

I am trying to associate C # with a prologue I used this link: enter the link here

I added SwiPlCs.dll as a reference to my project, and then used the first code in the documentation

using System; using SbsSW.SwiPlCs; namespace HelloWorldDemo { class Program { static void Main(string[] args) { //Environment.SetEnvironmentVariable("SWI_HOME_DIR", @"the_PATH_to_boot32.prc"); if (!PlEngine.IsInitialized) { String[] param = { "-q" }; // suppressing informational and banner messages PlEngine.Initialize(param); PlQuery.PlCall("assert(father(martin, inka))"); PlQuery.PlCall("assert(father(uwe, gloria))"); PlQuery.PlCall("assert(father(uwe, melanie))"); PlQuery.PlCall("assert(father(uwe, ayala))"); using (PlQuery q = new PlQuery("father(P, C), atomic_list_concat([P,' is_father_of ',C], L)")) { foreach (PlQueryVariables v in q.SolutionVariables) Console.WriteLine(v["L"].ToString()); Console.WriteLine("all child from uwe:"); q.Variables["P"].Unify("uwe"); foreach (PlQueryVariables v in q.SolutionVariables) Console.WriteLine(v["C"].ToString()); } PlEngine.PlCleanup(); Console.WriteLine("finshed!"); } } } } 

but the exception always goes ... he says that:

The specified module was not found. (Exception from HRESULT: 0x8007007E

in the SWI prolog, they talk about this error:

If libswipl.dll or one of its dependencies could not be found, you will get an error, for example System.IO.FileNotFoundException: Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E)

I copied libswipl.dll from the bin program to my bin / debug folder in my project, but still the same problem.

what should I do? Thanks

+4
source share
2 answers

Have you declared SWI_HOME_DIR? Must point to c` \ Program Files \ pl

The interface with C # does not work with 64-bit versions of Windows 7, Visual Studio 2010 is professional. It seems to be a mistake, Uwe Lesta should fix the error soon.

+3
source

I had the same error, so I downloaded SwiPlCs_1.1.60301.0 and I changed the name SwiPlCs64.dll to SwiPlCs.dll and I added it as a link in Visual Studio and it worked :) PS: I am using Visual Studio 2010 and Windows 7 64 bit. Hope this helps :)

0
source

All Articles