应用程序无法正常启动0xc000007b问题解决

问题描述

用vs编写的win32程序,在其他32位电脑上报vcruntime140.dll确实错误。最后将C:\Windows\System32下的vcruntime140.dll拷贝到文件运行目录,结果报0x0000007b错误。
错误原因是程序是32位的,使用64位的dll。解决办法是全部换成32位的dll

问题查找:

使用vs自带的dumpbin工具查看动态库位数。以vs2019为例 搜索 该文件x86_x64 Cross Tools Command Prompt for VS 2019,打开该文件
在命令行下输入dumpbin /headers 目标程序。按下回车键得到结果。

D:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>dumpbin /headers C:\Windows\System32\vcruntime140.dll
Microsoft (R) COFF/PE Dumper Version 14.28.29913.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\Windows\System32\vcruntime140.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
            8664 machine (x64)
               7 number of sections
        609DE407 time date stamp Fri May 14 10:44:23 2021
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
            2022 characteristics
                   Executable
                   Application can handle large (>2GB) addresses
                   DLL

发现该文件夹下的vcruntime140.dll是64位的。
于是找到C:\Windows\SysWOW64这个文件夹下的vcruntime140.dll看看

D:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>dumpbin /headers C:\Windows\SysWOW64\vcruntime140.dll
Microsoft (R) COFF/PE Dumper Version 14.28.29913.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\Windows\SysWOW64\vcruntime140.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
             14C machine (x86)
               5 number of sections
        604196CE time date stamp Fri Mar  5 10:26:22 2021
               0 file pointer to symbol table
               0 number of symbols
              E0 size of optional header
            2122 characteristics
                   Executable
                   Application can handle large (>2GB) addresses
                   32 bit word machine

这个文件夹才是32位的。把32位的vcruntime140.dll这个文件拷贝到运行目录即可,程序正常运行。64位库在32位上为什么报这个0x0000007b错误,还不知道,这个需要查一下。

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值