1 Attachment(s)
problem running and debugging using qt under windows
Hi,
I have downloaded boundle windows package including qt 5.6.2, qt creator 4.0.3 and MingW 4.9.2 (qt-opensource-windows-x86-mingw492-5.6.2.exe)
The I started a simple qt application
dialog.cpp
Code:
#include "dialog.h"
#include "ui_dialog.h"
ui(new Ui::Dialog)
{
ui->setupUi(this);
}
Dialog::~Dialog()
{
delete ui;
}
dialog.h
Code:
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
namespace Ui {
class Dialog;
}
{
Q_OBJECT
public:
explicit Dialog
(QWidget *parent
= 0);
~Dialog();
private:
Ui::Dialog *ui;
};
#endif // DIALOG_H
main.cpp
Code:
#include "dialog.h"
#include <QApplication>
int main(int argc, char *argv[])
{
Dialog w;
w.show();
return a.exec();
}
dialog.ui
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>PushButton</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
it compiles, but when I try to Run it fails with this message:
Code:
Starting C:\Documents and Settings\massimiliano\progs\build-test-Desktop_Qt_5_6_2_MinGW_32bit-Debug\debug\test.exe...
The program has unexpectedly finished.
C:\Documents and Settings\massimiliano\progs\build-test-Desktop_Qt_5_6_2_MinGW_32bit-Debug\debug\test.exe crashed.
and when I try to debug I have this error:
Attachment 12321
What is wrong with my setup?
best regards
max