PDA

View Full Version : Error running executable



Salazaar
20th May 2007, 18:09
Hi. I've got a problem. When compile project files:
Maker.cpp

#include <QtGui>

#include "maker.h"

MainWindow::MainWindow(QMainWindow *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
connect(actionAbout, SIGNAL(triggered()), this, SLOT(abcziom()));
}
void MainWindow::abcziom()

{
QMessageBox::warning(this, tr("About Application"),
tr("The <b>Application</b> example demonstrates how to "
"write modern GUI applications using Qt, with a menu bar, "
"toolbars, and a status bar."));

}

Maker.h

#ifndef MAKER_H
#define MAKER_H

#include "ui_maker.h"


class MainWindow : public QMainWindow, public Ui::MainWindow
{
Q_OBJECT

public:
MainWindow(QMainWindow *parent = 0);

private slots:

void abcziom();

private:

Ui::MainWindow ui;
};

#endif


ui_Maker.h, resource.qrc, and main.cpp:

#include <QApplication>
#include <QPlastiqueStyle>
#include "maker.h"

int main(int argc, char *argv[])
{
QApplication::setStyle ( new QPlastiqueStyle() );
QApplication app(argc, argv);
MainWindow MainWindow;
MainWindow.show();
return app.exec();
}
everything is ok, is builds the executable, but when I try to run it, there appear well known window - this is translation -
There appeared error with Test.exe application and it will be shut down. Sorry for problems. (the Polish version is: Wystąpił problem z aplikacją Test.exe i zostanie ona zamknięta. Przepraszamy za kłopoty.)
What is wrong? I tried to compile it twice, but without success. Regards

wysota
20th May 2007, 19:49
There is a good chance your application crashes ;) Try debugging it. What exact OS are you using?

Salazaar
20th May 2007, 19:57
I'm using Windows

wysota
20th May 2007, 19:58
Yes, I know that :) I was asking for a more specific response. And by the way, which compiler do you use?

marcel
20th May 2007, 20:01
What about actionAbout?
Where is that created?

Salazaar
20th May 2007, 20:04
Yes, I know that :) I was asking for a more specific response. And by the way, which compiler do you use?
I don't use a compiler, I compile everything by console (qmake -o Makefile...). Oh, sure, I'm using XP 2000 HE

What about actionAbout?
Where is that created?
It,s created in ui_maker.h

wysota
20th May 2007, 20:11
I don't use a compiler, I compile everything by console (qmake -o Makefile...).

http://en.wikipedia.org/wiki/Compiler

marcel
20th May 2007, 20:12
I don't use a compiler, I compile everything by console (qmake -o Makefile...). Oh, sure, I'm using XP 2000 HE
Oh, that will make things easier...

Try running the application without setting that style.
See if it works.

Anyway, I'm going to answer for you: you're using mingw - therefore the compiler is g++.

Salazaar
21st May 2007, 06:58
Yes I'm using MinGW compiler (sorry, wysota;))