前段时间我安装了MingW来学习使用NetBeans的C ++,但直到现在我还没找到时间。现在我创建了一个新的C ++项目,使用std::cout
创建了一个Hello World程序,它立即起作用。然后我试着写一个文件,但它失败了:
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char** argv) {
cout << "test" << endl;
fstream f;
f.open("a.txt", fstream::in | fstream::out | fstream::trunc);
f << "out" << endl;
f.close();
return 0;
}
lumosc(构建,运行):
cd 'D:\<My name>\Programmierung\NetBeans Projects\lumosc_1\lumosc'
D:\Programme\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
"/D/Programme/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/d/<My name>/Programmierung/NetBeans Projects/lumosc_1/lumosc'
"/D/Programme/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_1-Windows/lumosc.exe
make.exe[2]: Entering directory `/d/<My name>/Programmierung/NetBeans Projects/lumosc_1/lumosc'
mkdir -p build/Debug/MinGW_1-Windows
rm -f "build/Debug/MinGW_1-Windows/main.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/MinGW_1-Windows/main.o.d" -o build/Debug/MinGW_1-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW_1-Windows
g++ -o dist/Debug/MinGW_1-Windows/lumosc build/Debug/MinGW_1-Windows/main.o
make.exe[2]: Leaving directory `/d/<My name>/Programmierung/NetBeans Projects/lumosc_1/lumosc'
make.exe[1]: Leaving directory `/d/<My name>/Programmierung/NetBeans Projects/lumosc_1/lumosc'
输出(请注意,cout << "test" << endl;
未执行):
RUN FAILED (exit value -1.073.741.511, total time: 64ms)
我没有看到任何错误消息。但是,当我手动启动新创建的lumosc.exe
时,会弹出以下窗口:
(已翻译:未找到输入点 - 在“libstdc ++ - 6.dll”DLL中找不到过程入口点“__gxx_personality_v0”。)
以下是有关MingW安装的一些信息:
我对这个话题完全不熟悉,我希望有人可以帮助我!