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 退出?
基础教程推荐
- Windows Media Foundation 录制音频 2021-01-01
- 从 std::cin 读取密码 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01