kann jemand mir helfen, eine Reparatur zu finden, mein Problem, das ich gegenüberstelle. Diese Quinde des Fehlers scheint sehr oft zu passieren, aber jedes Mal mit anderen Problemen.Wie man den Fehler behandelt cygwin_exception :: open_stackdumpfile
Ich glaube, ich habe ein Problem bezüglich der Größe des fstream-Objekts? Wie in in gepostet Fehler mit der Matrix: cygwin_exception::open_stackdumpfile: Dumping stack trace to *.exe.stackdump
#include<iostream>
#include<fstream>
#include<string>
#include"ReaderWriter/WriterBuild.h"
using namespace std;
string path = "";
string file = "Testdatei.dat";
string message = "hallo";
bool status;
int main(){
//Testklasse erstellen
\t cout << "start" << endl;
\t WriterBuild Testwriter(&path, &file);
\t status = Testwriter.write(&message);
\t cout << status << endl;
\t //cout << "End";
\t return 0;
}
#ifndef READERWRITER_WRITERBUILD_H_
#define READERWRITER_WRITERBUILD_H_
#include <string>
#include <fstream>
#include <iostream>
namespace std {
class WriterBuild {
public:
\t WriterBuild(string *ppathname, string *pfilename);
\t virtual ~WriterBuild();
\t bool write(string *pmessage);
private:
\t fstream* _pfilestream;
\t void checkPath(string *ppath);
};
} /* namespace std */
#endif /* READERWRITER_WRITERBUILD_H_ */
#include "WriterBuild.h"
namespace std {
WriterBuild::WriterBuild(string *ppathname, string *pfilename) {
\t // TODO Auto-generated constructor stub
\t const char* pfile = pfilename->c_str();
\t \t fstream filestream;
\t \t filestream.open(pfile, ios::out | ios::app);
\t \t _pfilestream = &filestream;
\t \t if (!_pfilestream->good()){
\t \t \t cout << "Datei existiert nicht." << endl;
\t \t }
\t \t else{
\t \t \t cout << "Datei existiert" << endl;
\t \t \t }
\t \t cout << _pfilestream << endl;
}
WriterBuild::~WriterBuild() {
\t // TODO Auto-generated destructor stub
\t cout << "destructor-start" << endl;
\t cout << _pfilestream << endl;
\t _pfilestream->close();
\t cout << "destructor-ende" << endl;
}
bool WriterBuild::write(string *pmessage){
\t cout << "test pmessage: " << pmessage << endl;
\t return true;
}
void WriterBuild::checkPath(string *ppath){
}
} /* namespace std */
Ausgang:
enter codstart
Datei existiert
0xffffc940
test pmessage: 0x100407020
1
destructor-start
0xffffc940
105 [main] CMS_W_Engine 11556 cygwin_exception::open_stackdumpfile: Dumping stack trace to CMS_W_Engine.exe.stackdumpe here
Vielen Dank im Voraus für die Hilfe