c# - 如何将 SWI Prolog 连接到 Visual Studio 2012

标签 c# prolog swi-prolog interfacing

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

当涉及到以下代码时:

PlEngine.Initialize(param);

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

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

由于升级过程,任何人都可以发现我犯了什么错误或者如果可能的话我必须做一些修改吗?

关于我的代码的附加信息:

  • 我使用了最新的 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 位,但我仍然遇到同样的问题

非常感谢任何帮助。

非常感谢

最佳答案

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

参见:https://nuget.org/packages/SWI.Prolog

现在 VS2012 将识别 SWI.Prolog。

谢谢

关于c# - 如何将 SWI Prolog 连接到 Visual Studio 2012,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14555200/

相关文章:

prolog - 在 Prolog 中查找实体之间的连接

prolog - Prolog 中的逻辑

prolog - 从跟踪中隐藏谓词

swi-prolog - 日志通话 : what is the best way to run all test suites?

c# - 异常 block 之前是否需要一个空的评估堆栈?

c# - 仅在 .Net 中证书身份验证失败并出现 SSL 错误

prolog - 卡住多个变量

c# - 在 C# 中哈希 SHA1 大文件(超过 2gb)

c# - C#类的属性包

c - 从 XCode 中的 C 程序到 SWI-Prolog 的接口(interface)