Win7 安装 VS 2015 运行C++时提示ucrtbased.dll丢失 的解决方法

20 篇文章 0 订阅

This problem is from VS 2015 silently failing to copy ucrtbased.dll (debug) and ucrtbase.dll (release) into the appropriate system folders during the installation of Visual Studio. (Or you did not select “Common Tools for Visual C++ 2015” during installation.) This is why reinstalling may help. However, reinstalling is an extreme measure… this can be fixed without a complete reinstall.

First, if you don’t really care about the underlying problem and just want to get this one project working quickly, then here is a fast solution: just copy ucrtbased.dll from C:\Program Files (x86)\Windows Kits\10\bin\x86\ucrt\ucrtbased.dll (for 32bit debug) into your application’s \debug directory alongside the executable. Then it WILL be found and the error will go away. But, this will only work for this one project.

A more permanent solution is to get ucrtbased.dll and ucrtbase.dll into the correct system folders. Now we could start copying these files into \Windows\System32 and \SysWOW64, and it might fix the problem. However, this isn’t the best solution. There was a reason this failed in the first place, and forcing the use of specific .dll’s this way could cause problems.


The best solution is to open up the control panel –> Programs and Features –> Microsoft Visual Studio 2015 –> Modify. Then uncheck and re-check “Visual C++ –> Common Tools for Visual C++ 2015”. Click Next, then and click Update, and after a few minutes, it should be working.

If it still doesn’t work, run the modify tool again, uncheck the “Common Tools for Visual C++ 2015”, and apply to uninstall that component. Then run again, check it, and apply to reinstall. Make sure anti-virus is disabled, no other tasks are open, etc. and it should work. This is the best way to ensure that these files are copied exactly where they should be.

Note that if the modify tool gives an error code at this point, then the problem is almost certainly specific to your system. Research the error code to find what is going wrong and hopefully, how to fix it.

参考文献:

https://stackoverflow.com/questions/33743493/why-visual-studio-2015-cant-run-exe-file-ucrtbased-dll

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
当我们在使用VS编译程序,可能会遇到缺失msvcp140d.dll、vcruntime140d.dllucrtbased.dll的情况。这些DLL文件是Microsoft Visual C++ Redistributable所需要的运行库文件,缺少它们会导致程序无法正常运行解决这个问题有以下几种方法: 1. 安装Microsoft Visual C++ Redistributable包:首先,我们可以尝试安装或重新安装最新版本的Microsoft Visual C++ Redistributable包。我们可以在Microsoft官方网站上下载适合我们操作系统的对应版本的运行库,然后进行安装。 2. 检查编译选项:另一种方法是检查我们的编译选项是否正确配置。在VS中,我们可以通过以下步骤进行检查和更改:打开项目属性→配置属性→C/C++→代码生成→运行库,并选择合适的运行库选项(如使用动态(DLL)选项)。然后重新编译项目。 3. 复制DLL文件:如果上述方法无效,我们可以尝试手动复制缺失的DLL文件到系统中。首先,我们需要从可运行的电脑或者其他程序所在的文件夹中找到这些DLL文件。然后,将这些DLL文件复制到缺失的程序所在的文件夹中,或者复制到Windows的System32文件夹。最后,重新运行程序。 总之,缺失msvcp140d.dll、vcruntime140d.dllucrtbased.dll的情况是由于缺少Microsoft Visual C++ Redistributable的运行库文件所致。我们可以通过安装这个运行库包、检查编译选项或手动复制缺失的DLL文件等方法解决这个问题。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值