Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/131.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
std::endl导致崩溃 在一个简单的例子(我没有C++编程一段时间)的开发过程中,我遇到了一个奇怪的行为。以下hello world程序在Windows(Mingw)下崩溃:_C++_Crash_Stdout_Std_Mingw32 - Fatal编程技术网

std::endl导致崩溃 在一个简单的例子(我没有C++编程一段时间)的开发过程中,我遇到了一个奇怪的行为。以下hello world程序在Windows(Mingw)下崩溃:

std::endl导致崩溃 在一个简单的例子(我没有C++编程一段时间)的开发过程中,我遇到了一个奇怪的行为。以下hello world程序在Windows(Mingw)下崩溃:,c++,crash,stdout,std,mingw32,C++,Crash,Stdout,Std,Mingw32,错误消息是: example.exe不再工作 这是一个已知的问题还是我的一个明显错误 来自Windows的非常有意义的报告“example.exe不再工作…”您使用的是哪个版本的mingw?您使用的是32位还是64位系统和编译器?看起来像是在64位系统和操作系统上使用Mingw32(带有g++4.8.1)的库版本clashI am。但在64位系统上,32位应用程序通常不是问题。我当然可以测试Mingw-w64…请测试一下。是的,我同意,32位应用应该可以正常工作,我怀疑您的构建系统中存在一些错误

错误消息是:

example.exe不再工作


这是一个已知的问题还是我的一个明显错误

来自Windows的非常有意义的报告“example.exe不再工作…”您使用的是哪个版本的mingw?您使用的是32位还是64位系统和编译器?看起来像是在64位系统和操作系统上使用Mingw32(带有g++4.8.1)的库版本clashI am。但在64位系统上,32位应用程序通常不是问题。我当然可以测试Mingw-w64…请测试一下。是的,我同意,32位应用应该可以正常工作,我怀疑您的构建系统中存在一些错误配置,但我对Windows了解不多。@erburat
OutputDebugString
#include <iostream>

int main () {

    for (int idx = 0; idx < 5; idx++) {
        std::cout << "Hello World" << std::endl;
    }

    return 0;
}
g++ example.cpp -o example.exe
example.exe