如何将SWI Prolog与Visual Studio 2012连接起来

Bud*_*nto 6 c# prolog swi-prolog interfacing

我有一个程序在Visual Studio中连接SWI-Prolog.以前,我使用VS2010(XP),一切正常.然后我升级我的VS成为VS2012(Win7),现在我的代码有问题.

说到以下代码:

PlEngine.Initialize(param);
Run Code Online (Sandbox Code Playgroud)

它总是给我以下异常消息:

The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Run Code Online (Sandbox Code Playgroud)

任何人都可以发现我犯了什么错误,或者如果可能的话,我需要做一些修改,因为升级过程?

有关我的代码的其他信息:

  • 我使用了最新的swiPLCs库(版本:1.1.60301.0)
  • 我上面代码中的'param'是:string [] param = {" - q"," - f",@"c:\ program files(x86)\ pl \"};
  • 我已将路径环境变量设置为:c:\ program files(x86)\ pl \和c:\ program files(x86)\ pl\bin
  • 我在我的代码中有这个设置:Environment.SetEnvironmentVariable("SWI_HOME_DIR",Global.g_prologLocation);
  • 我有参考:swiPLcs.dll
  • 我已经尝试使用SWIProlog 64位,但我仍然遇到同样的问题

任何帮助都非常感谢.

非常感谢

Bud*_*nto 5

我终于得到了答案.与VS2010不同,在VS2012中,您似乎必须在VS2012中添加SWI-​​Prolog包.所以使用Nuget添加SWI.Prolog包.怎么样?

请参阅:https://nuget.org/packages/SWI.Prolog

VS2012现在将识别SWI.Prolog.

不管怎么说,还是要谢谢你