How to Interfacing SWI Prolog to the Visual Studio 2012
Asked Answered
G

1

6

I have a program that interfacing SWI-Prolog in Visual Studio. Previously, I used VS2010 (XP) and everything works fine. Then I upgrade my VS to become VS2012 (Win7) and now I have a problem in my code.

When it comes to the following code:

PlEngine.Initialize(param);

it always gives me the following exception message:

The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Can anybody spot what mistake that I made or if possible some modification that I have to do, due to the upgrading process?

Additional information regarding my code:

  • I used the most updated swiPLCs library (version: 1.1.60301.0)
  • my 'param' in my code above is: string[] param = { "-q", "-f", @"c:\program files (x86)\pl\"};
  • I have set the path environment variable to: c:\program files (x86)\pl\ and c:\program files (x86)\pl\bin
  • I have this setting in my code: Environment.SetEnvironmentVariable("SWI_HOME_DIR", Global.g_prologLocation);
  • I had the reference to: swiPLcs.dll
  • I already tried to use the SWIProlog 64 bit, but I still have the same problem

Any help is really appreciated.

Many thanks

Gaucho answered 28/1, 2013 at 3:50 Comment(0)
G
5

I finally got the answer myself. Unlike VS2010, In VS2012 it seems that you have to add SWI-Prolog package into VS2012. So add SWI.Prolog package using Nuget. How?

See: https://nuget.org/packages/SWI.Prolog

And VS2012 will recognize the SWI.Prolog now.

Thanks anyway

Gaucho answered 28/1, 2013 at 13:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.