为什么我所有的 C++ 程序都以 0xc0000139 退出?

Why are all my C++ programs exiting with 0xc0000139?(为什么我所有的 C++ 程序都以 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 退出?

基础教程推荐