什么会导致 C++ .exe 和 .dll 只能在构建它的机器上运行吗?
我正在使用 VS2010 并正在处理这个项目。
http://www.codeproject.com/KB/audio-video/Asio_Net.aspx最初
,我下载了演示二进制文件,它会在我的机器上崩溃。阅读了一些评论后,它说下载源代码,构建它(在获得 ASIO SDK 之后),它应该可以在您的计算机上运行。这是正确的,在 VS 中构建它之后,它可以在该机器上运行。
当我将重建的 .exe 和 .dll 移动到另一台计算机时,它崩溃并出现与最初下载的演示二进制文件相同的错误。所以我不确定什么会导致这种情况。我怎样才能让这个 C++ 二进制文件在任何机器上工作?
我是一名 C# 开发人员,大部分代码都是 C++,所以我有点不知所措。
顺便说一句,这是错误消息:
“未处理的异常:System.IO.FileNotFoundException:无法加载文件或屁股 embly 'Bluewave.Interop.Asio.dll' 或其依赖项之一。找不到指定的模块。在 BlueWave.Interop.Asio.Test.TestConsole.Main(String[] args)"
编辑:在这里找到答案: http://msdn.microsoft.com/en- us/library/8kche8ah(v=VS.100).aspx
使用依赖项遍历器查找缺少哪个 .dll。
I am using VS2010 and am working with this project.
http://www.codeproject.com/KB/audio-video/Asio_Net.aspx
Initially, I downloaded the demo binary and it would crash on my machine. After reading through some of the comments, it said to download the source, build it, (after getting the ASIO SDK), and it should work on your machine. This is correct, after building it in VS it works, on that machine.
When I moving the rebuilt .exe and .dll to a different machine, it crashes with the same error as the originally downloaded demo binary. So I am unsure what would cause this. How can I make this C++ binary work on any machine??
I am a C# developer and most of the code is c++, so am kind of at a loss.
BTW, here is the error message:
"Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass
embly 'Bluewave.Interop.Asio.dll' or one of its dependencies. The specified module could not be found.at BlueWave.Interop.Asio.Test.TestConsole.Main(String[] args)"
EDIT: Answer found here:
http://msdn.microsoft.com/en-us/library/8kche8ah(v=VS.100).aspx
Use dependency walker to find which .dll is missing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您的意思是您已包含此 dll -
Bluewave.Interop.Asio.dll
那么我能想到的只有几种解释:丢失的 dll 很可能是 VC++ 运行时的一部分,而不一定是 Asio 的一部分。
您构建它的计算机上的输出文件夹中还有什么?
Assuming you mean that you've included this dll -
Bluewave.Interop.Asio.dll
then there only a couple of explanations I can think of:The missing dll may well be part of the VC++ runtime and not necessarily part of Asio.
What else is in the output folder on the machine where you built it?
我已经从 Code Project 下载了该演示项目,我认为问题最可能的原因是缺少 Visual Studio C++ 2008 运行时依赖项。通过在计算机上安装运行时可再发行软件包来解决此问题。
注意:我使用Dependency Walker检查了该DLL的依赖关系。您甚至可以在分析模式下运行它,以便它在运行时准确地告诉您哪个依赖项会带来麻烦。
I've downloaded that demo project from Code Project and I think the most likely cause of the problem is that the Visual Studio C++ 2008 runtime dependency is missing. Solve this by installing the runtime redistributable package on the machine.
Note: I checked the dependencies of this DLL using Dependency Walker. You can even run this in profiling mode so that it will tell you at runtime exactly which dependency is proving troublesome.