Segmentation fault in QApplication constractor
-
Hi and welcome to devnet,
I don't have any solaris system nor an old Qt version like that but from your code you're calling setCodecForTr and setCodecForCStrings too early. You need to first create the QApplication.
-
@SGaist thanks for your help. I chnaged my code, but this dnt help. I also use my exceptions in my project and multiple inheritance for one my class. My class inherits from simple class and QAbstractTableModel, and in header file of my class i declare
class MyClass: public QAbstractTableModel, public SimpleClass
{
}May be reason is wrong generated code?
-
What is SimpleClass ?
-
Does the crash also happen if you only have:
QApplication app(argc, argv); QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); return app.exec();
in your main ?
-
@SGaist yes, I'm sory, needed to send you my main code earlier.
Look at my main code:
#include <QtGui/QApplication>
#include "MainWindow.h"
#include <QTextCodec>
#include "definitions.h"
#include <iostream>int main(int argc, char *argv[]) {
// initialize resources, if needed
// Q_INIT_RESOURCE(resfile);
#ifdef COMPILED
std::cerr<<"Compiled date and time: "<<COMPILED<<"\n";
#endif
#ifdef VERSION
std::cerr<<"Current veriosn: "<<VERSION<<"\n";
#endif
QApplication app(argc, argv);
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
MainWindow Form1;
Form1.show();
return app.exec();
} -
Again: before trying to analyze the results of your compiler, can you run a default application ?
-
If you want to use the solaris compiler with Qt you probably have to first recompile Qt yourself. Anyway, switching to g++ is not a bad idea in this case.