二进制内置vs 2008不在windows xp sp3中运行。 [英] Binary built in vs 2008 not running in windows xp sp3.

查看:107
本文介绍了二进制内置vs 2008不在windows xp sp3中运行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到了这个问题。我在visual studio 2008中有一个简单的基于控制台的项目,我在发布模式下构建并发布它。



我们发现在一个干净的Windows XP sp3机器上,双击时的可执行文件没有启动,并且抛出一个错误,表示配置不正确。我们通过在系统上安装VS2008可重新分发的软件包来解决问题。我的问题是:



1-为什么会这样?它并没有发生在所有的xp机器上,而是其中一些。令人难以置信的是,默认情况下,windows xp sp3中不存在运行简单win32程序的文件。那么notepad.exe和其他程序在哪里运行呢?我考虑的一种可能性可能是操作系统中存在的运行时文件较旧,而exe清单指的是较新版本的文件。但我想知道是不是这样,因为VS 2008本身已经很老了。让我知道你的想法。



2-由于我必须在很多机器上运行exe,我正在考虑一种静态链接所有需要的库的方法在VS 2008中的win32程序。我知道链接器选项中的/ MT开关,但是想知道它是否会处理所有运行时库(C ++库和其他Windows库)。



谢谢。

I recently ran into this problem.I had a simple console based project in visual studio 2008 which I built in release mode and released it.

We found that in a clean windows xp sp3 machine , the executable on double clicking does not start and an error is thrown up which says that the "Configuration is incorrect". We fixed the problem by installing the VS2008 re-distributable package on the system. My question is :

1- Why did this happen? It did not happen in all xp machines but some of them. It is quite unbelievable that the files need to run a simple win32 program were not present by default in windows xp sp3. How is it then that notepad.exe and other programs where running ? One possibility that I considered might be that the run time files present in the OS were older and the exe manifest were referring to the newer version of the files. But I wonder if this is the case , as VS 2008 itself is quite old. Let me know your thoughts.

2- Since I have to run the exe in a lot of machines , I was considering a way to statically link all the needed libraries by a win32 program in VS 2008. I am aware of the /MT switch in the Linker options , but was wondering if it will take care of all the run time libraries(the C++ libraries and the other windows libraries as well).

Thanks.

推荐答案

Visual c ++应用程序具有标准c库函数的特殊运行时间。您的系统中可能有多个版本的dll,但该应用程序链接到特定的dll版本。此dll由Side By Side系统通过检查应用清单中的相应版本提供。如果未找到所请求的版本,则会生成错误。您可以使用sxstrace工具(包含在windows中)来跟踪sbs配置问题。



但是对于Windows库,它们(大多数)使用本机windows apis( ?我没有他们的源代码!)。如果它们引用标准c库,它们会动态链接到msvcrt.dll,即windows的默认c运行时。



你也可以链接到msvcrt,除非您需要一个仅在特定vs版本crt。
Visual c++ apps have a c special run-time for standard c library functions. There may be number of versions of the dll in your system, but the app is linked to a particulan dll version. This dll is provided by the Side By Side system by checking for the appropriate version in the app manifest. If the requested version is not found, an error is generated. You can use the sxstrace tool (included in windows) to trace sbs configuration problems.

However in the case of windows libraries, they (mostly) use native windows apis (? I don't have their source code!). If at all they refer to standard c libraries, they are dynamically linked to msvcrt.dll, the default c runtime of windows.

You can also link to msvcrt, unless you require a special feature found only in the particular vs version crt.


这篇关于二进制内置vs 2008不在windows xp sp3中运行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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