Getting error on release mode
Hello,
I derived a class from QGLWidget, after i add this widget in my application it works well in debug mode if i change to release mode i'm getting this error ;
http://img202.imageshack.us/img202/9960/59785133.th.png
Click for see Image
Do you have any idea about that ?
Ps Qt Version 4.7 i have booth debug and release libraries ..
Re: Getting error on release mode
Do you use some assertions? If yes then probably you are using it wrong!
I don't see another explanation since erros says that QApplication was not created.
How you main function looks like?
Re: Getting error on release mode
Code:
int main(int argc, char *argv[])
{
QPixmap pix
(":/Images/Splash.png");
SplashScreen Splash(pix,305, 22);
Splash.setMask(pix.mask());
Splash.setWindowOpacity(0);
Splash.show();
for (int i=0; i<100; ++i ) {
Sleep(10);
Splash.setWindowOpacity(i*0.01);
}
Initialization(&Splash);
[B] MainWindow w;
[/B] w.show();
Splash.finish(&w);
return a.exec();
}
MainWindow, on this step ;
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
[B]ui->setupUi(this);[/B]
.
.
.
}
ui_mainwindow.h :
glArea = new GLWidget(frmOperation);
i'm getting error on this step : glArea = new GLWidget(frmOperation);
but it works well in debug mode ...
Re: Getting error on release mode
Show the code of GLWidget constructor. Have you tried to make a clean release build (make clean, qmake, make release) ?
Re: Getting error on release mode
GLWidget::GLWidget (QWidget *parent) : QGLWidget(parent) {
}
There is no code in ctor. I tried clean and rebuikd again and again still getting same error :s
Re: Getting error on release mode
Are you including some additional libraries in release mode ? Can we see .pro file ?
Re: Getting error on release mode
I'm using Visual Studio , i double checked compile, linker options it is look like fine. I made simple application just using my GLWidget it works on release and debug, i'm gonna checking project settings again ..
Added after 14 minutes:
in QWidget.cpp :
if (!qApp) {
qFatal("QWidget: Must construct a QApplication before a QPaintDevice");
return;
}
static QCoreApplication *instance() { return self; }
qApp (self) is gets NULL in release mode but it gets valid value in debug mode
Re: Getting error on release mode
guys, i stuck with this, is there any idea ?
Re: Getting error on release mode
Quote:
I made simple application just using my GLWidget it works on release and debug, i'm gonna checking project settings again ..
You got it working already, right ?
Re: Getting error on release mode
Yay it works atm. Thanks for help ...