visual-studio - Visual Studio 2019 'DLL 初始化失败' - 我无法运行应用程序
问题描述
直到昨天我都很好地使用了 VS2019。今天,当我使用 F5 或 Ctrl-F5 运行我的 c++ 程序时,我收到了错误消息框。我有下一条调试消息。
'cpp.exe' (Win32): Loaded 'C:\Users\user\source\repos\learn\x64\Debug\cpp.exe'. Symbols loaded.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'cpp.exe' (Win32): Unloaded 'C:\Windows\System32\KernelBase.dll'
'cpp.exe' (Win32): Unloaded 'C:\Windows\System32\kernel32.dll'
The thread 0x2a54 has exited with code 3221225794 (0xc0000142).
The program '[13484] cpp.exe' has exited with code 3221225794 (0xc0000142) 'DLL Initialization Failed'.
有时,它适用于下一个调试消息。
'cpp.exe' (Win32): Loaded
'C:\Users\user\source\repos\learn\x64\Debug\cpp.exe'. Symbols loaded.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1d.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'.
The thread 0x2e88 has exited with code 0 (0x0).
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'.
'cpp.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'.
The thread 0x477c has exited with code 0 (0x0).
The thread 0x335c has exited with code 0 (0x0).
The program '[17728] cpp.exe' has exited with code 0 (0x0).
我认为加载 vcruntime*.dll 有问题,但我不知道该怎么办。
有线的事情是它有时会起作用。
任何建议将不胜感激。
解决方案
您的应用程序 (cpp.exe) 是 32 位还是 64 位构建的?你在你的应用程序中使用 LoadLibrary 吗?您是否链接到特定的库?尝试加载 32 位库的 64 位程序可能会出现问题,反之亦然。如果您可以发送复制此问题的代码,那么解决您的问题会容易得多。
推荐阅读
- c# - 使用 foreach 循环和 LINQ 的操作有什么区别?
- swift - 调用中的参数标签不正确(有'uiImage:',预期'来自:')
- javascript - 如何将输入限制在一个值范围内
- visual-studio-code - 无论如何以编程方式重新启动我的 VSCODE 扩展?
- python - 我的海龟没有检测到输入,它可以越过边界
- makefile - 双向编解码器的 Makefile
- java - ANDROID:MVVM + Retrofit:我应该如何以及在哪里从 JSON 对象数组中检索 JSON 对象列表?
- ios - 如何使用短信实现inapp purchase iOS web app
- javascript - 遍历选择中的所有选项并将值添加到选项名称
- string - 在 SPARQL 中反转字符串