在 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"
我有一个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
本身无关。0xc00007b
是STATUS_INVALID_IMAGE_FORMAT
,所以可能是一些DLL或文件损坏。
这个问题可以通过修复或重新安装Visual Studio来轻松解决。
相关文章:
- C++:Application.cpp中抛出了未解析的外部符号(解决方案在问题的末尾,供未来的读者参考)
- 如何修复"error: ‘_1’ was not declared in this scope"?
- 为什么我会收到"Run-Time Check Failure #2 - Stack around the variable 'pr' was corrupted"错误?
- wx通用目录控制错误"wxTheFileIconsTable was nullptr"
- 为什么调试器引发"read access violation. this was nullptr"异常?
- 删除分配的 (?) 指针时"Pointer being freed was not allocated"
- 向unordered_map添加unique_ptr时'this was nullptr'
- 类中的数组变量C++导致"was not declared in this scope"实现文件的一个函数中错误,但在构造函数中不会导致错误
- 如何识别符号表中的符号是我'application'函数
- 无法创建 DLL:获取 DLL "is not a valid Win32 application"
- 函数 AfxEndThread 中的读取访问冲突"pThread-> was nullptr"
- 如何解决"cout was not declared in this scope"错误?
- C++ DLL 运行时错误"abc.dll is not a valid WIN32 application" 。请帮助解决这个问题
- C++ libtins "An invalid handle was specified"
- 为什么程序显示我"was not declared in this scope"?
- 调用 RevokeDragDrop 后"OLE The application called an interface that was marshalled for a different thre
- 打开简历,C++:"Error: The application was unable to start correctly (0x0000005)."
- 包含 VLD.h 后的"The application was unable to start correctly"
- 在 Visual Studio 2010 中使用SDL_image,错误"application was unable to start correctly 0xc000007b"
- 在 64 位应用中使用 std::string:"The application was unable to start correctly 0xc00007b"