VC2005-应用程序正常初始化失败-0xc0150002

合集下载

VC++2005编译出程序在XP下执行出错的解决方法

VC++2005编译出程序在XP下执行出错的解决方法
Searchingd:\ProgramFiles\MicrosoftVisualStudio8\VC\lib\OLDNAMES.lib:
Searchingd:\ProgramFiles\MicrosoftVisualStudio8\VC\atlmfc\lib\atls.lib:
Searchingd:\ProgramFiles\MicrosoftVisualStudio8\VC\PlatformSDK\lib\ws2_32.lib:
Searchingd:\ProgramFiles\MicrosoftVisualStudio8\VC\PlatformSDK\lib\shell32.lib:
Searchingd:\ProgramFiles\MicrosoftVisualStudio8\VC\PlatformSDK\lib\comctl32.lib:
修改成Multi-threaded(/MT)
修改了Runtime类型以后
需要将MFC的编译类型也改成静态库
Project->Property->configurationProperties->General->UseofMFC
修改成UseMFCinaStaticLibrary
一部分情况下在这步就能解决问题
Searchingd:\ProgramFiles\MicrosoftVisualStudio8\VC\PlatformSDK\lib\winspool.lib:
Searchingd:\ProgramFiles\MicrosoftVisualStudio8\VC\PlatformSDK\lib\advapi32.lib:
而动态MFC库使用的是Multi-threadedDLL(/MD)

应用程序配置不正确或初始化失败

应用程序配置不正确或初始化失败

与VC6不同, VC2003、VC2005、VC2008及其后续版本,引入了manifest清单的概念,即应用程序编译后会同时生成对应的.manifest文件,并将该.manifest文件作为资源编译到dll或者exe中去。

manifest文件实际上是一个XML格式的文本文件,里面记录了dll或exe中要引用的CRT、MFC、ATL库的版本和名称。

VC6编译的应用程序对CRT、MFC、ATL的dll都是直接调用,而VC2003、VC2005、VC2008编译的程序都是先查询编译到资源中的manifest中的记录,然后按照记录提供的版本和名称去搜寻对应的CRT、MFC、ATL库,搜索路径为环境变量中定义的路径,若搜索到的文件版本号不匹配,则不会调用,从而导致应用程序配置不正确,程序无法启动或初始化失败等错误(相关信息可以在电脑日志中查看得知)。

DLL的版本信息可以使用HA-eXeScope650-moming.exe软件查看,如下图所示(红色框内既为版本号):至于你系统内的版本号,可以到VS安装目录下的查看,本文以VS2008 CRT库为例:可以看到,其版本号均为9.0.30729.4148,于上面DLL的一致,故不会存在问题VS2008的使用库目前为止分为三个版本:●没有打过任何补丁的VS2008该版本对应的CRT/MFC/ATL库的版本号为9.0.21022.8。

●2、打过SP1补丁的VS2008和KB973675补丁打过该补丁后,系统中存在着两个版本的CRT/MFC/ATL库,版本号分别为9.0.21022.8和9.0.30729.1,这导致了manifest文件中记录的版本号和实际库的版本号不一致(程序要求它们的版本号一致才能运行)。

这时需要在工程设置中增加一个宏定义_BIND_TO_CURRENT_VCLIBS_VERSION,该宏定义于C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtassem.h文件中,然后重新编译程序。

vs2005+ ogre 出现“应用程序正常初始化(0xc0150002)失败”

vs2005+ ogre 出现“应用程序正常初始化(0xc0150002)失败”

vs2005+ ogre 出现“应用程序正常初始化(0xc0150002)失败”的解决方法我用vs2005+ogre SDK里的例子编译运行,出现了“应用程序正常初始化(0xc0150002)失败”的错误,之后看了很多帖子解决了问题.如果vs2005,不是sp1的,要打sp1的补丁,vs2005中文版补丁是 VS80sp1-KB926604-X86-CHS.exe,400多M英文版要用另外一个 ,具体名字不记得。

然后打完补丁再装vcredist_x86.exe 这个比较小,就十几M。

如果上面的步骤都进行过了还不行,要再打个补丁/download/D/2/3/D23F9F62-3DEE-4EC0-B3B9-D64E9F573D1F/VS80sp1-KB971090-X86-INTL.exe注意,这个不是一般情况下说的sp1补丁,sp1是KB926601,400M左右,这个是KB971090,200M左右(1)打sp1的补丁下载地址1为:/download/6/3/c/63c69e5d-74c9-48ea-b905-30ac3831f288/VS80sp1-KB926601-X86-ENU.exe(英文版)下载地址2为:/download/8/0/7/8071514d-9370-45c3-8af1-4ff09a70e59d/VS80sp1-KB926604-X86-CHS.exe(中文版)大约为430M。

(2)装vcredist_x86.exe/soft/16405.html<注意双击vcredist_x86.exe,不要双击Setup.exe。

>(3)下载安装VS80sp1-KB971090-X86-INTL.exe/download/D/2/3/D23F9F62-3DEE-4EC 0-B3B9-D64E9F573D1F/VS80sp1-KB971090-X86-INTL.exe注意,这个不是一般情况下说的sp1补丁,sp1是KB926601,400M 左右,这个是KB971090,200M左右。

应用程序初始化失败问题(Applicationinitializationfailed)

应用程序初始化失败问题(Applicationinitializationfailed)

应用程序初始化失败问题(Application initialization failed)The application failed to initialize _~ ~!Application initialization failed (oxc0000005) reasons and Solutions1, Microsoft IE buffer overflow vulnerability caused2, memory or virtual memory address conflict program needs to be allocated to address certain procedures to use, when new procedures for the use of space to release at the end of the program, win is a multi tasking system before the program does not end sometimesThere is a new task to how much memory or virtual memory to ensure that we run at the same time the task? Perhaps win on this issue is not ready, so the errors often occur, the general operation of the large-scale software or multimedia3, poor memory will appear this problem in general, memory problems are not likely, the main aspect is: bad memory, memory quality problems, there are 2 different brands of different memory mixed interpolation, are more prone to incompatible situation, but also pay attention to the heat problem, especially after overclocking. You can use the MemTest software to check memory, which can thoroughly detect the stability of memory. If you are dual memory, and the memory of different brands, mixed in, or bought a secondary memory, this problem occurs, then you have to check whether the memory problems, or incompatible with other hardware.4, Microsoft WINDOWS system vulnerabilities, windows memory address 0X00000000 to 0X0000ffff designated as assigned null pointer address range, if the program attempts to access this address, is considered to be wrong. Programs written by c/c++ usually do not undergo rigorous error checking and return null pointers when malloc is used to allocate memory and the assigned address space is insufficient. However, the code does not check this error, considers that the address assignment has been successful, so it accesses the address of the 0X00000000, so memory violation access occurs, and the process is terminated. The following ASCII character fill consisting of PIF file: an illegal PIF file (filled with a ASCII character \''x\'') at least 369 bytes, the system was considered to be a valid PIF file, 0] will display to the PIF icon, [pifmgr.dll, will have a program, font, memory, screen etc. the contents in the attributes. And when a non PIF file is 369 bytes in size, the program's error is not detected even if it is 370 bytes. When a PIF file is larger than 369 bytes for illegal property "program" page, Explorer will go wrong, that \''***\''Command Reference \''***\'' memory. This memory cannot be \''read\''The problem is in the 16 hexadecimal address of the PIF file: 0x00000181[0x87]0x00000182[0x01] and0x00000231[0xC3]0x00000232[0x02] even if it's a legitimate PIF file, it can cause program errors whenever you change any of these places. As long as the value of 0x00000181 and 0x00000182 is changed to [0xFF][0xFF], any change of other addresses will not cause errors.5, there may not be a Apache service is installed correctly,and started its service in the cause; OracleOraHomeXXHTTPServer to stop6, the application does not check the memory allocation failure procedure requires a memory to save the data, you need to call the operating system to provide a "function" to apply, if successful memory allocation, memory area function will be the new return to the application, the application can use this memory via this address. This is the "dynamic memory allocation", the memory address, that is, "pointer" in programming". Memory is not always available, endless, and sometimes memory allocation will fail.When the allocation fails, the system function returns a 0 value, when the return value "0" does not represent the newly enabled pointer, but rather a notification issued by the system to the application informing the error. As an application, in the memory after each application should check whether the return value is 0, if it is, it means that there is a fault, some measures should be taken to save, which enhances the robustness of the program "". If the application does not check the error, it will continue to use this memory in subsequent operations, in accordance with the thinking inertia that the value is the pointer that is allocated to it. The real 0 address memory area holds the most important "interrupt descriptor table" in the computer system and absolutely does not allow the application to use. In the operating system without protection mechanism under (such as DOS), write data to this address will lead to crash immediately, and in the robust operating system, such as Windows, this operation will be immediately captured the protection mechanism of the system, the result is forciblyclosed by the operating system application error, in order to prevent the error expansion. At this point, the above "write memory" error occurs and indicates that the referenced memory address is "0x00000000"". Memory allocation failure, many reasons, memory is insufficient, the version of the system function mismatch, and so may have an impact. Therefore, the distribution of failure in the operating system to use for a long time, the installation of a variety of applications (including accidentally "Install" virus program), after the change of system parameters and system of a large number of documents.7, the application due to its unusual BUG quoted the memory pointer in the application using dynamic allocation, sometimes there will be such a situation: the program attempts to write a "should be available" in memory, but I do not know why, it is expected that can be a pointer has been a failure. There may be "forget" to the operating system requirements distribution, or it may be the program itself at some point has canceled the memory, and "no attention" and so on. Off the system memory to be recycled, the access does not belong to the application, read and write operations can also trigger a mechanism to protect the system, trying to "end" illegal procedures only termination of the operation is to be run, all resource recovery. The laws of the computer world are still much more effective and harsher than human beings! A situation like this belongs to the BUG of the program itself, and you can often reproduce errors in a particular order of operations. The invalid pointer is not always 0, so the memory address in the error is not necessarily "0x00000000", but rather the other random numbers.If the system often mentions errors, the following suggestions might help:1. check whether there is a Trojan horse or virus in the system. In order to control the system, such programs often change the system without responsibility, resulting in abnormal operating systems. Generally, we should strengthen the awareness of information security and not be curious about the executable programs of unknown sources.2. update the operating system so that the operating system's installer re copies the correct version of the system file and changes the system parameters. Sometimes, the operating system itself will have BUG, pay attention to install the official release of the upgrade program.3. try out a new version of the application.4, delete, and then recreate the WINDOWS\Wbem\RepositoryFile in the folder: right click on my computer on the desktop, and then click manage. Under services and applications, click service, then close and stop Windows ManagementInstrumentation service. DeleteWINDOWS\System32\Wbem\RepositoryAll files in the folder. (create a backup copy of these files before deleting.) Open the service and application, click service, and then open and start Windows ManagementInstrumentation service. When the service restarts, these files are recreated based on the information provided in the following registry key:hkey_local_machine \软件\微软\ \ \”MOFs CIMOM WBEM下面我从几个例子给大家分析:例一:打开IE浏览器或者没过几分钟就会出现”0x70dcf39f”指令引用的”0x00000000”内存。

VC++应用程序无法正常启动0xc0150002

VC++应用程序无法正常启动0xc0150002

VC++应⽤程序⽆法正常启动0xc0150002 使⽤VC++开发软件,编译后的程序打不开,弹出错误框: 使⽤Dpends Walker查看依赖项,没有什么异常。

然后,右键“计算机”,选择“管理”,打开计算机管理,在左侧树形结构中,选择“系统⼯具 -> 事件查看器 -> Windows⽇志 -> 应⽤程序”,找到最近事件的应⽤程序错误: 错误就发⽣在vld_x86.dll上,该dll与应⽤程序在同⼀⽬录下,XML描述如下: <Event xmlns="/win/2004/08/events/event">- <System><Provider Name="SideBySide"/><EventID Qualifiers="49409">33</EventID><Level>2</Level><Task>0</Task><Keywords>0x80000000000000</Keywords><TimeCreated SystemTime="2016-11-28T07:20:04.000000000Z"/><EventRecordID>8786</EventRecordID><Channel>Application</Channel><Computer>Michael</Computer><Security /></System>- <EventData><Data>Microsoft.DTfW.DHL,processorArchitecture="x86",type="win32",version="6.11.1.404"</Data><Data /><Data /><Data /><Data /><Data /><Data /><Data /><Data /><Data /><Data>D:\*\vld_x86.dll</Data><Data /><Data /><Data /><Data /><Data /><Data /><Data /><Data /><Data /></EventData></Event> 该dll是使⽤Visual Leak Detector for Visual C++ 运⾏时要依赖的dll,发现是拷贝过来的⽂件不全,缺⼀个清单⽂件(Microsoft.DTfW.DHL.manifest),最好将下列三个⽂件(C:\Program Files (x86)\Visual Leak Detector\bin\Win32)全部拷贝过来:dbghelp.dllMicrosoft.DTfW.DHL.manifestvld_x86.dll  备注:未安装Visual Leak Detector for Visual C++的请先安装!。

应用程序正常初始化(0xc0000005)失败

应用程序正常初始化(0xc0000005)失败

应用程序正常初始化(0xc0000005)失败说明文字:PAGE-FAULT-IN-NONPAGED-AREA通常的原因:内存错误(数据不能使用分页文件交换到磁盘中).解决方法:卸掉所有的新近安装的硬件.运行由计算机制造商提供的所有系统诊断软件.尤其是内存检查.检查是否正确安装了所有新硬件或软件,如果这是一次全新安装,请与硬件或软件制造商联系,获得可能需要的任何Windows更新或驱动程序.禁用或卸载所有的反病毒程序.禁用BIOS内存选项,例如cache或shadow.应用程序初始化内存分配错误。

0xc0000005错误发生的诱因主要分为四大类:1、自由表存储载体的缺陷(主要体现在VCX、VCT,SCX和SCT上)。

2、第三方监控性质的软件。

(如:防毒软件在内存即时监控状态下、词霸软件在全屏拾取模式下等);3、VisualFoxpro自身的代码漏洞;4、硬件因素。

建议断开网络,然后关闭防火墙,再安装试试,如果不行,重启电脑再试,再不行则归类为程序缺陷了。

存不能为“read”或“written”的解决方案有些人运行飚车程序的时候会弹出该内存不能为“read”的错误提示。

希望以下文章能对大家有所帮助。

使用Windows操作系统的人有时会遇到这样的错误信息,运行某些程序的时候,有时会出现内存错误的提示,然后该程序会自动关闭或点击后关闭,严重的会无法关闭。

“0x????????”指令引用的“0x????????”内存。

该内存不能为“read”。

“0x????????”指令引用的“0x????????”内存,该内存不能为“written”。

不知你出现过类似这样的故障吗?(0x后面内容有可能不一样。

)散一般出现这个现象有方面的,一是硬件,即内存方面有问题,二是软件,这就有多方面的问题了。

1、微软IE缓冲溢出漏洞引起2、内存或虚拟内存地址使用冲突造成程序的运行需要分配一定的内存地址给程序使用,当程序结束时释放留出空间让给新的程序使用,win是多任务的系统有时前程序未结束又有新的任务开始到底要多少内存或虚拟内存来保证我们同时运行的工作任务呢?也许win在这个问题上没弄好,所以有此错误常常发生,一般运行大型软件或多媒体后出现这种情况3、劣质内存条也会出现这个问题一般来说,内存出现问题的可能性并不大,主要方面是:内存条坏了、内存质量有问题,还有就是2个不同牌子不同容量的内存混插,也比较容易出现不兼容的情况,同时还要注意散热问题,特别是超频后。

vs2005编译的程序不能启动大致有两个原因

vs2005编译的程序不能启动大致有两个原因

如果是debug版, 就复杂一些了, 首先要确定你需要的DLL的版本, 绝大多数(注意:不是"所有")情况下它和编译器的版本相同, 通过vs2005的关于对话框就能看到, 如下图所示:
确定版本后, 在开发组的机器上进入“%windir%\winsxs"文件夹(下面将以x86平台8.0.50727.762版本的debug CRT为例进行说明) 需要依版本号而定的部分用加粗表示, 拷贝以下文件到目标机器的相同位置即可:
2. 开发机运行正常, 换到其它机器上就不行了
这一般就是系统DLL(包括CRT, MFC, ATL等)没有正确配置导致的。
如果程序是release版, 那么很简单, 只要把“\SDK\v2.0\Boovcredist_x86.exe"拷贝到目标机器上运行即可.(解释一下——拷贝这个程序到目标机然后运行,像是装了一个什么东西。装完了以后再运行用平台开发出来的程序,如果还提示有什么DLL找不到,那就把开发机上相应的DLL拷贝出来,贴到用户机中相应的文件夹里面。比如一个MFC的什么DLL找不到,在开发机上搜索这个DLL,记住它的路径,然后按这个路径贴到用户机上。) 这是以x86平台为例的, 如果你用的是别的CPU平台(amd64或ia64)把x86替换成相应的内容就可以了。
x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f文件夹下所有文件;
Manifests文件夹下
x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f.cat
x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f.manifest

WIN7下QQ打不开,应用程序无法正常启动(0xc0150002)

WIN7下QQ打不开,应用程序无法正常启动(0xc0150002)

WIN7下QQ打不开,应用程序无法正常启动(0xc0150002)(2010-07-19 09:10:17)转载标签:itWIN7下QQ打不开,应用程序无法正常启动(0xc0150002)有的网友在装完WIN7后,会立即安装QQ,但是在装完QQ后才发现,QQ根本打不开,出现:应用程序无法正常启动(0xc0150002)的错误信息,笔者也遇到了这个情况,不管是QQ2010还是QQ2009,均出现上述错误提示!可尝试以下2种方法:1:开始菜单-重启系统,不要按机箱上的重启按钮强制重启。

重启完毕后再打开QQ看看。

ps:在重启的时候,屏幕会显示正在安装已下载的更新,在这些更新中,可能会包含下面链接的更新,也就是支持QQ运行的VC库,等我们安装完这个更新并重启后,QQ就能打开了!2:如果上述方法仍未解决,点击下面的链接下载VC库,下载安装后,再重启系统就能打开QQ了!/s/blog_5d2ced280100isvs.html有一位网友给笔者来信问道:是不是一定要让电脑联网完成更新之后,才可装其它软件?其实这个担心也是有一定道理的,比如某些软件需要VC库和.Net的支持,但是像这样的需要安装系统的某一个更新才能使用的软件毕竟还是少数,所以大家在装完WIN7后,可以立即安装其他软件!!强烈推荐:优盘已不再中毒,三步打造彻底防毒的优盘/s/blog_5d2ced280100k6f0.html桌面图标不能删除的解决方法/s/blog_5d2ced280100itle.html如果你的右键菜单没有“运行桌面清理向导”、桌面属性的自定义桌面中也没有“现在清理桌面”选项,请参考文章:/s/blog_5d2ced280100iuvn.html动手美化你的优盘,为你的优盘添加图像背景/s/blog_5d2ced280100k6pu.html关闭系统的自动更新方法如下,与上面的QQ打不开无任何关系,大家觉得没必要就可以关闭了:开始菜单,在搜索框中输入服务,打开服务。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

最近几天被这个问题困惑了许久。

不禁感叹微软的东东真是越做越烂了,也终于明白了时隔12年大家仍然死守VC6的原因。

用VC2005编译的程序,编译时没有任何错误,但是运行时就是提示“应用程序正常初始化失败”!!查找了各方面资料,做了各种尝试,网上说什么的都有:有让安装vc2005 sp1补丁的;有让安装vcredist_x86.exe的; 有让把CRT库的dll直接拷贝到程序目录的; 有让清理注册表的;有让装.NetFramework新版本的;有让查manifest的;结果我尝试了半天,几乎都是浪费时间。

上面最后一条说的还算正确,只是作者把事情描述得太繁琐了。

现在把处理的方法说一下,省得大家再走弯路:1. VC2003、VC2005、VC2008及其后续版本,对底层最基本的CRT、MFC、ATL库都进行了重构,为了避免不同版本的库引起冲突,重构后的库文件一般放在C:\\windows\WinSxS 文件夹中,并用特定的文件夹\文件名称进行标识;2. 与VC6不同, VC2003、VC2005、VC2008及其后续版本,引入了manifest 清单的概念,即应用程序编译后会同时生成对应的.manifest文件,并将该.manifest 文件作为资源编译到dll或者exe中去。

.manifest文件实际上是一个XML格式的文本文件,里面记录了dll或exe中要引用的CRT、MFC、ATL库的版本和名称。

VC6编译的应用程序对CRT、MFC、ATL的dll都是直接调用,而VC2003、VC2005、VC2008编译的程序都是先查询编译到资源中的manifest中的记录,然后按照记录提供的版本和名称去搜寻对应的CRT、MFC、ATL库以及随库发布的.manifest文件,搜寻的路径包括当前目录、C:\\windows\WinSxS 等等,如果没有找到对应的库文件,则提示“应用程序正常初始化失败”;3.因此解决这个问题的办法就是:(a)用文本编辑器打开exe或dll对应的.manifest文件,查看它引用的CRT、MFC、ATL库的版本;或者,用UltraEdit 直接打开exe或者dll,从资源区中找到编译进去的.manifest信息,找到它引用的CRT、MFC、ATL库的版本;或者,运行程序,当程序弹出“应用程序正常初始化失败”对话框时,在桌面上右键点击“我的电脑”-“管理”-“事件查看器”-“系统”,双击查看其中的记录,可以看到出错的原因是因为缺少了某某版本的CRT、MFC、ATL库,记录下这个版本信息;(b)记录到的库的版本信息一般类似于“Microsoft.VC90.DebugCRT”,之后到C:\\windows\WinSxS 或者VC200X的安装文件夹中搜索包含这个字符串的文件夹和文件,将搜索到的dll和.manifest文件都拷贝到应用程序所在的文件夹中,其中,.manifest文件必须重命名为“Microsoft.VC90.DebugCRT.manifest”(这里以Microsoft.VC90.DebugCRT为例),这样应用程序就可以正常运行了;(c)注意:库的.manifest文件和dll要一同拷贝到应用程序根目录去,因为应用程序会将编译到内部的manifest信息与外部的.manifest文件进行对比,之后才会对库的dll进行调用。

如果只拷贝库的dll文件是没有用的;4.如果本机编译和运行程序都ok,但是将编译好的程序拿到其它机器上确无法运行,则多半也是这个原因。

另外,如果提示"应用程序配置不正确",大多也是因为上面所说的CRT、MFC、ATL库版本与应用程序不匹配导致的,可以如法炮制进行解决;在网上找出了这些方法:方法一:在类似C:\Program Files\Microsoft Visual Studio 8\VC\redist\Debug_NonRedist\x86\Microsoft.VC80.DebugCRT 下找到了下列文件:msvcm80d.dllmsvcp80d.dllmsvcr80d.dllMicrosoft.VC80.DebugCRT.manifest把这几个文件拷贝到目标机器上,与运行程序同一文件夹或放到system32下,就可以正确运行了。

其他release版、MFC程序什么的都是拷redist下相应文件夹下的文件就可以了,文件夹后都有标识!方法二:修改编译选项,将/MD或/MDd 改为/MT或/MTd,这样就实现了对VC运行时库的静态链接,在运行时就不再需要VC的dll了。

方法三:工程-》属性-》配置属性-》常规-》MFC的使用,选择“在静态库中使用mfc”这样生成的exe文件应该就可以在其他机器上跑了。

方法四:你的vc8安装盘上找到再分发包vcredist_xxx.exe和你的程序捆绑安装在大部分机上都可以运行了,唯独在我的测试机上还是报应用程序配置错误。

刚开始怀疑是还缺少dll,在能跑的机上把windows/system32目录下所有的msvc*.dll都复制到这台机的运行目录,还是不行!极度郁闷※×…!后来实在没辙了,就在VC环境中打开了EXE来查看它内嵌的manifest资源,无奈了看了一会,带着心中对manifest的咒骂,突然发现这个manifest带了两个版本CRT的依赖:再打开Microsoft.VC80.CRT.manifest一看,是这样:就是说,我们EXE的Manifest里多了一个版本依赖,那就把后面那个依赖删除试试。

于是就把工程设置的生成manifest的选项去掉,手工改了一下manifest放到程序目录下,发现果然可以运行了!还有个问题没有明白,就是VC为什么在自 傻膍anifest里带了两个依赖呢,上网再查了一下,发现在msdnonline上说'8.0.50608.0'这个版本是在XP下用的,'8.0.50727.762'这个版本是在Vista下用的(/en-us/library/ms235342(VS.80).aspx),可是我用的是'8.0.50727.762'在XP下运行的好好的!想不通是它错了还是别的原因。

后来在CRT的源码里面搜索'8.0.50727.762',找到了~'8.0.50608.0'也在那里。

#if defined _USE_RTM_VERSION#define _CRT_ASSEMBLY_VERSION “8.0.50608.0”#else#define _C RT_ASSEMBLY_VERSION “8.0.50727.762”#endif显然默认的版本是“8.0.50727.762”,除非定义了_USE_RTM_VERSION!那为什么我们的工程会生成两个版本的依赖呢,明明这个地方是二选一的。

一开始怀疑是工程设置引起的,我就把我们的工程拷出来,把里面的文件删掉,再复制一些向导生成的文件进来,编译一看,manifest 里只有一个'8.0.50727.762',说明工程设置没有问题!最后我怀疑是工程链接的那些库的问题,因为有些库是用VC6或者VC2003编译的,但是有些库没有代码,编不了,没法尝试了。

VC++ 解决"应用程序配置不正确,程序无法启动"2009-03-03 10:05在使用VC++2005环境下生成的程序,放置到未安装VC环境的机器下后,有时候会出现程序无法执行的错误,其提示是:应用程序配置不正确,程序无法启动,重新安装应用程序可能解决问题。

实际上,重装是解决不了问题的,解决的一种方法是查看*exe.intermediate.manifest文件,比如文件的内容是:<?xml version='1.0' encoding='UTF-8' standalone='yes'?><assembly xmlns='urn:schemas-microsoft-com:asm.v1'manifestVersion='1.0'><dependency><dependentAssembly><assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86'publicKeyToken='1fc8b3b9a1e18e3b' /></dependentAssembly></dependency><dependency><dependentAssembly><assemblyIdentity type='win32' name='Microsoft.VC80.MFC' version='8.0.50727.762' processorArchitecture='x86'publicKeyToken='1fc8b3b9a1e18e3b' /></dependentAssembly></dependency><dependency><dependentAssembly><assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT'version='8.0.50727.762' processorArchitecture='x86'publicKeyToken='1fc8b3b9a1e18e3b' /></dependentAssembly></dependency></assembly>需要注意这个文件中的3个关键词:Microsoft.VC80.CRT,Microsoft.VC80.MFC和Microsoft.VC80.DebugCRT。

寻找到...."Program Files"Microsoft Visual Studio 8"VC"redist文件夹下面,找到这些名称的子文件夹,拷贝它们下面所有的文件到希望发布的EXE文件下面,一起打包。

相关文档
最新文档