可执行文件在32位上运行,但不在64位上运行 [英] Executable runs on 32-bit but not on 64-bit

查看:418
本文介绍了可执行文件在32位上运行,但不在64位上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个项目,我最初是在32位PC上开发的。我最近收到了一台64位的新PC,我可以在这台机器上成功编译项目。但是,当我尝试运行它时,我得到以下错误,我从未在32位
PC上看到过:

I have a project that I originally developed on a 32-bit PC. I recently received a new PC that is 64-bits and I can compile the project successfully on this machine. However, when I try to run it I get the following error, which I never seen on the 32-bit PC:

"类型未处理的异常Project1.exe中发生'System.DllNotFoundException'
$


其他信息:无法加载DLL'jtag_atlantic.dll':找不到指定的模块。 (来自HRESULT的异常:0x8007007E)"

如果我使用相同的可执行文件,在64位PC上编译的可执行文件,再到32位PC它运行正常。所以我可以编译它但不运行它。

If I take that same executable, the one that was compiled on the 64-bit PC, over to a 32-bit PC it runs fine. So I can compile it but not run it.



它抱怨的dll的一些背景知识。我提供了一个用于编译.lib的DLL驱动程序。这是在32位机器上完成的。那个.lib链接到我的项目中,所以它实际上不需要dll所以我不确定它为什么抱怨


Some background on the dll it is complaining about. I was provided with a dll driver which was used to compile a .lib. This was done on a 32-bit machine. That .lib is linked into my project, so it actually doesn't need the dll so I am not sure why it is complaining about it.

问题可能是那个.lib是在32位PC上创建的吗?

Could the problem be that the .lib was created on a 32-bit PC?

我尝试将dll放在工作目录中但是没有用,但不管怎样它都不需要它。

I tried placing the dll in the working directory but that didn't work but it shouldn't need it anyway.



谢谢大家,非常感谢你的帮助!


Thanks guys, your help is much appreciated!

Joe S。

推荐答案

根本没有什么可以与您构建的PC相提并论。重要的是在项目中设置x64,x86等体系结构的设置。

It makes no difference at all what PC you build something on. What matters is the setting in the project where you target an architecture like x64, x86.

在您的情况下,您可能已经使用MSIL构建了一个托管代码exe,因此它可以在任何体系结构上运行本机上。如果它在x64模式下运行x64,则无法加载32位Dll。如果你还没有第三方Dll的64位版本,那么所有调用
的代码都必须以x86为目标。

In your case you may have built a managed code exe with MSIL so it runs native on whatever architecture it's on. If it runs on x64 in x64 mode it cannot load a 32-bit Dll. If you haven't got a 64-bit version of that 3rd party Dll then all code that calls it must target x86.


这篇关于可执行文件在32位上运行,但不在64位上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆