Re: A problem while trying to interface C# with prolog

Uwe Lesta <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <DADDA4CE0F00374BB9EA2BEDBFF2CCDF602BF228CB@SERVER.SBS.SBS-Softwaresysteme.de>
Just to have the solution on the mailing list.

> -----Original Message-----
> From: Önder Açıkgöz [mailto:[email protected]]
> Sent: Wednesday, March 12, 2014 11:51 PM
> To: Uwe Lesta
> Subject: Re: An Interface between SWI-Prolog and C#
> 
> Hello again,
> I was very new to visual studio so I could not guess this. I have now
> achieved to initialise it when I allowed visual studio to work with x86.
> 
> On the solution explorer, I viewed right click and then went to build
> tab, there I have chosen to "platform target" as x86.Now it seemed to
> be working. Now I can try to run it with my prolog file.
> 
> Thank you very much for your interest and sparing your time on this.
> 
> I'm really too grateful
> 
> Sincerely,
> 
> Önder
> 
> 
> On Thu, Mar 13, 2014 at 12:37 AM, Önder Açıkgöz <[email protected]>
> wrote:
> 
> 
> 	On 64 bit machine with 32 bit SWI- Prolog version 6.6.2
> 
> 	I have downloaded the dll and tried. and I get the error below :
> 
> 
> 	Failure initializing Prolog:  is not a valid Win32 application.
> (Exception from HRESULT: 0x800700C1)
> 
> 
> 
> 	On Wed, Mar 12, 2014 at 11:57 PM, Uwe Lesta <Lesta@sbs-
> softwaresysteme.de> wrote:
> 
> 
> 		To be sure about your environment
> 
> 		You have a 64 bit machine.
> 		Installed a 32-bit SWI-Prolog version 6.6.2
> 		Download
> http://www.lesta.de/prolog/swiplcs/download/SwiPlCs_1.1.60301.0.zip
> 		And use SwiPlCs.dll




> -----Original Message-----
> From: [email protected]
> bonn.de [mailto:swi-prolog-bounces+lesta=sbs-
> [email protected]] On Behalf Of Önder Açikgöz
> Sent: Wednesday, March 12, 2014 9:52 PM
> To: [email protected]
> Subject: [SWIPL] A problem while trying to interface C# with prolog
> 
> Hello there,
> 
> I am having some difficulty while trying to interface c# with swi-
> prolog. I
> tried to follow this method : http://www.swi-
> prolog.org/contrib/CSharp.html
> using visual studio 2008 on 64 bit windows 7 machine.  My code is quite
> simle  but i cannot get it to work :( :
> 
> 
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
> using SbsSW.SwiPlCs;
> 
> 
> namespace ConsoleApplication1
> {
>     class Program
>     {
>         static void Main(string[] args)
>         {
>             Environment.SetEnvironmentVariable("SWI_HOME_DIR",
> @"C:\Program
> Files (x86)\pl\");
>             Environment.SetEnvironmentVariable("PATH", @"C:\Program
> Files
> (x86)\pl\");
>             Environment.SetEnvironmentVariable("PATH", @"C:\Program
> Files
> (x86)\pl\bin\");
>            if (!PlEngine.IsInitialized)
>                 {
>                     try
>                    {
>                       SbsSW.SwiPlCs.PlEngine.Initialize(new string[] {
> ""
> });
>                   }
>                    catch (System.Exception ex)
>                     {
>                         Console.WriteLine("Failure initializing Prolog:
> " +
> ex.Message);
>                        // return;
>                    }
>                 }
>               Console.ReadLine();
>         }
>     }
> }
> 
> 
> I get error messages like "the specified module could not found" or "
> is
> not a valid Win32 application " depending on the version of SwiPlCs.dll
> file...
> 
> I will be very grateful for any help...
> 
> Thank you
> 
> Önder
> -------------- next part --------------
> HTML attachment scrubbed and removed
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
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.