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
source share