[英]Unable to load “lpsolve55.dll” in VS2015 on 64-bits OS
For a project I am working on, I need to solve a mathematical model. 对于我正在从事的项目,我需要解决一个数学模型。 I chose to do this using Microsoft.Solver.Foundation and the SolverFoundation.Plugin.LpSolve plugin.
我选择使用Microsoft.Solver.Foundation和SolverFoundation.Plugin.LpSolve插件来执行此操作。 Both associated .dll files for these extension seem to work fine, as VS2015 recognizes and references them without a problem and compiles and runs my program without errors.
与这些扩展名相关联的两个.dll文件似乎都可以正常工作,因为VS2015可以毫无问题地识别并引用它们,并且可以编译并运行我的程序而不会出现错误。
This is however up untill I try to actually solve my optimization, which needs "lpsolve55.dll" to work. 但是,直到我尝试实际解决优化问题为止,这需要“ lpsolve55.dll”才能起作用。 I have downloaded this dll and put it in my project's bin/Debug folder, but for some kind of reason VS2015 just doesn't recognize it.
我已经下载了该dll并将其放在项目的bin / Debug文件夹中,但是由于某种原因,VS2015不能识别它。 Ie
即
So basically, after discovering the above (after trying the most-common internet solutions), I still feel quite dissatisfied to get the error message while I try to solve the optimization - 因此,基本上,在发现上述内容之后(尝试了最常见的Internet解决方案之后),我仍然很不满意在尝试解决优化问题时收到错误消息-
Unable to load DLL 'lpsolve55.dll': The specified module could not be found.
无法加载DLL'lpsolve55.dll':找不到指定的模块。 (Exception from HRESULT: 0x8007007E)
(来自HRESULT的异常:0x8007007E)
The wierd part is also that I have another project in which I solve a similar problem, where there are absolutely no problems at all using lpsolve55.dll.... 更奇怪的是,我还有另一个项目可以解决类似的问题,使用lpsolve55.dll绝对没有问题。
Some quick facts: 一些事实:
My question would thus be whether or not some of you have encountered a similar problem and if you were able to solve it in some way. 因此,我的问题是你们中的某些人是否也遇到过类似的问题,以及您是否能够以某种方式解决它。
Highly appreciated! 高度赞赏!
After some careful analysis, I have found the answer to the problem. 经过仔细分析,我找到了问题的答案。 To be honest, as most things are, it was quite simple in the end.
坦白说,就像大多数事情一样,最后很简单。 The lpsolve55.dll wasn't recognized because I didn't have my new bin-folder in the Path, which I did have with my old project.
无法识别lpsolve55.dll,因为我在Path中没有新的bin文件夹,而我在旧项目中确实有。 I simply forgot.
我简直忘记了。
On a further note however, after the lpsolve55.dll directory was added to the path, I still got an error telling me there was no model to be found that could solve my directive. 但是,还需要注意的是,在将lpsolve55.dll目录添加到路径后,我仍然收到一条错误消息,告诉我没有找到可以解决我的指令的模型。 Since the error occured when I was calling the LPSolverDirective(), some research landed me on the following page:
由于在我调用LPSolverDirective()时发生了错误,因此一些研究使我进入了以下页面:
http://lpsolve.sourceforge.net/5.5/MSF.htm http://lpsolve.sourceforge.net/5.5/MSF.htm
Above page gives a complete and stable way of how to acces lpsolve55.dll using the LPSolverPlugin straight out of Microsoft.Solver.Foundation.dll. 上一页提供了一种直接使用Microsoft.Solver.Foundation.dll来使用LPSolverPlugin访问lpsolve55.dll的完整,稳定的方法。 After following the method in the link that involves editing my projects' bin/Debug and bin/Release folders, I got the LP model up and running within no-time.
在遵循了涉及编辑项目的bin / Debug和bin / Release文件夹的链接中的方法之后,我立即启动了LP模型并使其运行。
Morale of the story - read the documentation. 故事的士气-阅读文档。 I am a bit of a beginner in programming entire multi-project solutions and using customly-added dlls, but hopefully this helps someone else experiencing the same.
在编写整个多项目解决方案和使用自定义添加的dll方面,我是一个初学者,但是希望这可以帮助其他经历过此问题的人。 In the end, I learned a lot by simply trying different methods of getting it to work, so no time was wasted.
最后,我通过尝试不同的方法使其工作而学到了很多东西,所以没有浪费时间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.