0

A while ago I installed MingW to learn C++ with NetBeans, but until now I didn't find the time. Now I created a new C++ project, made a Hello World program with std::cout and it worked immediately. Then I tried to write a file, but it failed:

#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 (Build, run):

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'

Output (Note that cout << "test" << endl; wasn't executed):

RUN FAILED (exit value -1.073.741.511, total time: 64ms)

I didn't see any error message. However, when I started the newly created lumosc.exe manually, the following window popped up:

Error message: Einsprungspunkt nicht gefunden

(Translated: Entry point not found - The procedure entry point "__gxx_personality_v0" was not found in the "libstdc++-6.dll" DLL.)

Here's some information about my MingW installation:

Version info


I'm completely new to this topic and I hope somebody can help me out!

Aloso
  • 5,123
  • 4
  • 24
  • 41
  • I just ran your code on VS and it worked fine as I expected. I don't have Net Beans on this machine so I can't try it there. Did Net beans provide the "int argc, char** argv" in the main header? If so then I would take it out, recompile... At any rate it is a Net Beans issue – Dr t May 17 '17 at 15:51
  • Thanks for your help, it's very appreciated. Removing the parameters didn't solve it, so I will now install VS. Anyway, I'd like to know why this error occurs. – Aloso May 17 '17 at 18:07
  • I have used Net Beans a lot and i have always found it to be clunky in comparison to other compilers. Free isn't always better. You will like VS much better. – Dr t May 18 '17 at 15:31
  • It's not a NetBeans problem - please look at this question and its answers: http://stackoverflow.com/questions/18668003/the-procedure-entry-point-gxx-personality-v0-could-not-be-located – HEKTO May 21 '17 at 22:55

0 Answers0