在 64 位应用中使用 std::string:"The application was unable to start correctly 0xc00007b"

Using std::string in 64-bit app: "The application was unable to start correctly 0xc00007b"

本文关键字:application was The to 0xc00007b correctly start unable string 应用 std      更新时间:2023-10-16

我有一个c++ Visual Studio项目:

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s1 = "This is a string";
    cout << "s1  is: " << s1 << endl;
    return 0;
}

当我在配置管理器中更改项目平台为x64时,我得到运行时错误:

应用程序无法正确启动(0xc00007b).

点击OK会得到消息:

MyConsoleApplication.exe中0x000007FB4FB72100 (ntdll.dll)的未处理异常:0xC000007B: %hs不是设计用于在Windows上运行或包含错误。尝试使用原始安装介质重新安装程序,或与系统管理员或软件供应商联系以获得支持。错误状态0x.

这可能是一些x86x64冲突,但我找不到任何关于在64位应用程序中使用std::string的参考。

任何想法?

(转发我的评论作为答案)

这当然与在x64环境中使用std::string本身无关。0xc00007bSTATUS_INVALID_IMAGE_FORMAT,所以可能是一些DLL或文件损坏。

这个问题可以通过修复或重新安装Visual Studio来轻松解决。

相关文章: