How to link SWI Prolog with Visual Studio 2012

I have a program that interacts with SWI-Prolog in Visual Studio. I used to use VS2010 (XP) and everything works fine. Then I update 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); 

he always gives me the following exception message:

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

Can someone determine what mistake I made or, if possible, some kind of modification that I have to do due to the update process?

Additional info about my code:

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

Any help really appreciated.

Many thanks

+6
source share
1 answer

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

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

And VS2012 now recognizes SWI.Prolog.

Thank you anyway

+5
source

All Articles