并排错误 [英] side by side error

查看:77
本文介绍了并排错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2005/2008构建一个基于mfc对话框的简单项目
该程序可以在某些计算机上运行,​​而在其他计算机上则可以并排显示错误.

如果我在其他计算机上构建相同项目,则该程序可在所有计算机上运行 ..

解决方案

这是一个非常无意义的错误,表示所需的CRT或MFC运行时不存在.未安装在计算机上.

将项目更改为:
如果使用的是MFC,请将Project>Properties>General>Use of MFC更改为U se MFC in a Static Library,否则将其保留为Use Standard Windows Liraries
AND
Project>Properties>C/C++>Code Generation>Runtime Library设置为名称中没有DLL,以便它使用静态链接

或者,从MSDN获取您的MFC和Visual Studio版本的运行时.
Visual Studio 2008 x86 [ ^ ]
Visual Studio 2005 SP1 x86 [ ^ ]
要查找其他(包括x64),只需使用Google"Visual Studio redist"


为了明确起见,运行时将安装在要运行.exe的计算机上,并且平台与尝试运行的.exe相同(即Win32 .exe将需要x86 redist,即使它在Windows XP上运行)也是如此.一台x64计算机).


Rajesh Katalkar:
但是该程序可以在无法运行的计算机上运行
如果在其他计算机上构建,则无需进行任何修改


这仍然支持我的答案.在这种情况下将发生以下情况:
生成计算机A使用Visual Studio W编译了项目,Visual Studio W具有MFC X
生成计算机B使用Visual Studio Y编译了项目,Visual Studio Y具有MFC Z

这意味着该项目需要不同版本的Visual Studio可再发行文件.
因此,您在其上测试项目的计算机可能仅具有Build computer B所需的可再发行文件,这意味着该项目仅在从该计算机编译时才能运行.

通过获取 Dependency Walker [ 解决方案

This is a very un-informative error which means the required CRT or MFC run-times aren''t installed on the computer.

Either change the project to:
If you are using MFC, change Project>Properties>General>Use of MFC to Use MFC in a Static Library, otherwise leave it as Use Standard Windows Liraries
AND
Set the Project>Properties>C/C++>Code Generation>Runtime Library to not have DLL in the name so it uses static linking

or, get the run-times for your version of MFC and visual studio from MSDN.
Visual Studio 2008 x86[^]
Visual Studio 2005 SP1 x86[^]
To find the others (including x64) just google "Visual Studio redist"

EDIT:
Just to clarify, the runtimes are to be installed on the computer you are running it on, with the same platform that the .exe you are trying to run (i.e. a Win32 .exe will need the x86 redist, even if it is running on a x64 computer).


Rajesh Katalkar :
but the program works on the computer where it was not working
without any modification if built on some other machine


This still supports my answer. The following will be happening in a situation like this:
Build computer A compiled the project with Visual Studio W, which has MFC X
Build computer B compiled the project with Visual Studio Y, which has MFC Z

This means that the project requires different versions of the Visual Studio Redistributable files.
So, the computer you were testing the project on may only have the redistributable files required by Build computer B, meaning the project will only work if it was compiled from that computer.

You can verify by what I am saying by grabbing a copy of Dependancy Walker[^] and opening the executable file. This will show the DLL files required for the program to run. There will be files named something like MSVCRT, MSVCR, MSVCM, ATL, MFC, ...
All these files will have a version number in the name, and can be found in the Side-by-Side directory C:\Windows\WinSxS (SxS = Side-by-Side)

If you run Dependancy Walker on the build computer it will find all the required DLLs, if you run it on a computer that shows the error message, it will show an error message saying that it couldn''t find all the dependencies.

Both solutions from my previous answer will correct this problem will correct it.


这篇关于并排错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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