How to Interfacing SWI Prolog to the Visual Studio 2012

最后都变了- 提交于 2019-12-08 21:42:53

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/14555200/how-to-interfacing-swi-prolog-to-the-visual-studio-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!