在启动过程中,程序退出,代码为0xc0000139 [英] During startup program exited with code 0xc0000139

查看:1012
本文介绍了在启动过程中,程序退出,代码为0xc0000139的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:

事实证明这是一个编译器问题(我使用的是 MinGW ),因此解决方法正在切换到另一个编译器(在本例中为 Cygwin >).

This turned out to be a compiler issue (I was using MinGW) so a workaround is switching to another compiler (in this case Cygwin).

(原始)问题

我是一名学生,开始独自学习 C ++ ,在尝试与string

I'm a student starting to learn C++ by myself and I have come across a problem when trying to work with string

这是我的测试代码(无效的代码)

This is my test code (the one that isn't working)

#include <iostream>
#include <string>

using namespace std;

int main()
{
    string myString;

    cin >> myString;
    cout << myString;

    return(0);
}

当我尝试运行它时,该程序刚刚结束并退出了,然后我才可以输入任何东西,这就是我尝试从gdb

When I tried to run it, the program just ended and exited before I can input anything, and this is the result when I tried to run from gdb

(gdb) run
Starting program: C:\Users\DANIEL~1\AppData\Local\Temp\sandbox.exe
[New Thread 15036.0x31bc]
[New Thread 15036.0x2db4]
[New Thread 15036.0x2628]
[New Thread 15036.0x2280]
During startup program exited with code 0xc0000139.
(gdb)

当我尝试制作文件并从cmd运行它时

When I tried to make the file and run it from cmd

g++ sandbox_string.cpp -o sandbox_string

(我添加了_string并将其与_int makefile分开,程序仍然相同)

(I added the _string to separate from the _int makefile, the program is still the same)

我收到此错误: 找不到入口点

经过Google的一次旅行后,我认为此问题与缺少DLL 有关.我怎么知道我缺少哪些dll,有没有办法确保我拥有每个dll?

After a trip round Google I believe that this problem is related to missing DLLs. How can I know what dll(s) I'm missing and is there a way to make sure I have every dlls ?

我想提一些要点:

•我承认这可能与为什么我的所有C ++程序都以0xc0000139退出?,但是除了降级GCC之外,它没有提供其他解决方案.我试过了,但是没有用.同样在这个问题中,有人提到缺少DLL ,但没有提供进一步的解决方案.

• I'm acknowledged that this may be a duplicate to Why are all my C++ programs exiting with 0xc0000139?, but that provided no solution other than downgrading GCC. I tried that and it didn't work. Also in that question someone mentioned about missing DLLs, but provided no further solution.

•例如,如果我尝试cin一个整数:

• If I tried to cin an integer for example:

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int myString;
    cin >> myString;
    cout << myString;
    return(0);
}

工作正常,我可以输入,程序将输出然后正常退出:

It works fine, I can input and the program would output then exit normally:

(gdb) run
Starting program: C:\Users\DANIEL~1\AppData\Local\Temp\sandbox.exe
[New Thread 9120.0x35ac]
[New Thread 9120.0x2c4c]
[New Thread 9120.0x390c]
[New Thread 9120.0x32c0]
7
7[Inferior 1 (process 9120) exited normally]
(gdb)

•我的编译器是 MinGW ,这是我的MinGW安装程序屏幕截图,其中包含(希望)您需要的所有详细信息 MinGW安装程序

• My compiler is MinGW, this is my MinGW installer screenshot with (hopefully) every details you need MinGW Installer

•我使用的是 Atom -一个文本编辑器,带有一个可编译和运行C ++代码的插件(称为"gpp-compiler"),因为我发现坚持使用一个文本编辑器会很舒服但是,如果您认为我还应该使用其他东西,请告诉我.

• I'm using Atom - a text editor, with a plugin to compile and run C++ code (called "gpp-compiler") because I find it comfortable to stick with one text editor instead of using IDEs, but, if you think there's something else I should be using, please let me know.

•我对编程并不陌生,但是对C ++还是很陌生,所以如果有任何愚蠢的错误,请原谅我,这也意味着我非常喜欢可能的简单答案/解决方案.但是我不会有复杂的答案并伴有适当的解释.

• I'm not new to programming but I'm (very) new to C++ so please pardon me if there is any silly mistake, also this also means that I greatly prefer simple answer/solution if possible. But I will have no problem with complicated answer that's accompanied by a proper explanation.

谢谢

推荐答案

该代码似乎没有错误.但是如上所述,这一直是编译器问题,因此从 MinGW 切换到 Cygwin 已解决了该错误.

The code seems to have no errors. but as it mentioned above this has been a compiler issue so switching to Cygwin from MinGW has solved the error.

配置错误,重要文件丢失或损坏时,将显示错误代码0xc0000139.因此切换到完全不同的编译器已解决了该问题.

The error code 0xc0000139 appears when mis-configured, important files gone missing or damaged. so switching in to a totally different compiler has solved the problem.

希望这将有助于提高@Daniel D的问题价值.

hope this will help to improve this questions value @Daniel D.

这篇关于在启动过程中,程序退出,代码为0xc0000139的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆