Why are all my C++ programs exiting with 0xc0000139?(为什么我所有的 C++ 程序都以 0xc0000139 退出?)
问题描述
我正在尝试自学使用 C++ 编程,并在安装了 g++ 的 Windows 上使用 Cygwin.在我开始声明字符串变量之前,一切都很顺利.将字符串文字与 cout 一起使用不会导致任何问题,但是一旦我声明了字符串变量,程序将不再运行.
I am trying to teach myself to program in C++ and am using Cygwin on Windows with g++ installed. Everything was going swimmingly until I started to declare string variables. Using string literals with cout causes no issues, but as soon as I declare a string variable the program will no longer run.
#include <iostream>
#include <string>
int main ()
{
std::string mystring = "Test";
std::cout << mystring;
return 0;
}
前面的代码编译没有问题,但是运行时没有输出.GDB 为我提供了以下内容:
The preceding code compiles without issue, but when run produces no output. GDB provides me with the following:
(gdb) run
Starting program: /cygdrive/c/Projects/CPP Test/string.exe
[New Thread 8416.0x2548]
[New Thread 8416.0x2510]
[New Thread 8416.0x1694]
[New Thread 8416.0x14f4]
[Thread 8416.0x1694 exited with code 3221225785]
[Thread 8416.0x14f4 exited with code 3221225785]
During startup program exited with code 0xc0000139.
据我所知,这是 DLL 的某种入口点问题,但我可能完全错了.
From what I have managed to gather this is some sort of entry point issue with a DLL, but I could be completely wrong.
有谁知道我做错了什么或配置错误以及如何解决?
Does anyone know what I have done wrong or what I have misconfigured and how to fix it?
推荐答案
好吧,我不确定到底是什么问题(如果有人知道,我将不胜感激!),但我能够自己解决它从 GCC 5.2.0 降级到 GCC 4.9.3.
Well I'm not sure what the problem was exactly (if anyone knows I'd be grateful!), but I was able to solve it for myself by downgrading from GCC 5.2.0 to GCC 4.9.3.
这篇关于为什么我所有的 C++ 程序都以 0xc0000139 退出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么我所有的 C++ 程序都以 0xc0000139 退出?
基础教程推荐
- 初始化列表*参数*评估顺序 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- CString 到 char* 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
