Qt Creator: Rückgabewert -1073741819
Qt Creator: Rückgabewert -1073741819
Hallo,
Wollte gerade ein Projekt starten, aber nach einer Weile kam dann folgende Fehlermeldung:
Rückgabewert -1073741819
Bei Google habe ich schon einige Sachen darüber gefunden, aber nie wirklich eine richtige Lösung.
Ist es also ein Problem von Qt Creator oder von meinem Code?
Wenns um meinen Code geht würd ich ihn posten, da es eh nciht so lang ist
mfg
Wollte gerade ein Projekt starten, aber nach einer Weile kam dann folgende Fehlermeldung:
Rückgabewert -1073741819
Bei Google habe ich schon einige Sachen darüber gefunden, aber nie wirklich eine richtige Lösung.
Ist es also ein Problem von Qt Creator oder von meinem Code?
Wenns um meinen Code geht würd ich ihn posten, da es eh nciht so lang ist
mfg
Re: Qt Creator: Rückgabewert -1073741819
Das ist der Rueckgabewert von Deinem Programm, nach dem es fertig ist.
OK, es ist ein ganz einfaches Test-Programm (ein einfacher Text-Editor):
main.cpp:
dialog.h:
dialog.cpp:
form.h:
form.cpp:
ui_dialog.h:
Und noch die Projekt-Datei:
ICh hoffe mal das ist jetzt nicht zu viel Code, aber da ich nciht weiß wo der Fehler leigt kann ich ihn nicht kürzen.
mfg
main.cpp:
Code: Alles auswählen
#include <QApplication>
#include "form.h"
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
myDialog *dlg = new myDialog;
dlg->show();
return app.exec();
}
Code: Alles auswählen
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
namespace Ui {
class Dialog;
}
class Dialog : public QDialog {
Q_OBJECT
public:
Dialog(QWidget *parent = 0);
~Dialog();
protected:
void changeEvent(QEvent *e);
private:
Ui::Dialog *ui;
};
#endif // DIALOG_H
Code: Alles auswählen
#include "dialog.h"
#include "ui_dialog.h"
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
form.h:
Code: Alles auswählen
#ifndef FORM_H
#define FORM_H
#include <QtGui>
#include <QDialog>
#include "ui_dialog.h"
class myDialog : public QDialog {
Q_OBJECT
public:
myDialog();
~myDialog() {}
private:
Ui::Dialog ui;
private slots:
void analyseDialog();
};
#endif
form.cpp:
Code: Alles auswählen
#include "form.h"
myDialog::myDialog (){
ui.setupUi(this);
connect( ui.pushButton, SIGNAL( clicked() ),
this, SLOT(analyseDialog()) );
}
void myDialog::analyseDialog() {
QString str;
if( ui.lineEdit->text().isEmpty())
str.append("Name: keine Angaben\n");
else {
str.append("Name: ");
str.append(ui.lineEdit->text());
str.append("\n");
}
if( ui.spinBox->cleanText().isEmpty())
str.append("Geburtsdatum: keine Angaben\n");
else {
str.append("Geburtsdatum: ");
str.append(ui.spinBox->cleanText());
str.append("\n");
}
if( ui.radioButton->isChecked())
str.append("Geschlecht: weiblich\n");
else
str.append("Geschlecht: männlich\n");
QMessageBox::information(
0, tr("Die Auswertung"), str );
}
Code: Alles auswählen
/********************************************************************************
** Form generated from reading UI file 'dialogrW4556.ui'
**
** Created: Mon 16. Aug 16:45:29 2010
** by: Qt User Interface Compiler version 4.6.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef DIALOGRW4556_H
#define DIALOGRW4556_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QGroupBox>
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QRadioButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QSpinBox>
#include <QtGui/QTextEdit>
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Dialog
{
public:
QWidget *layoutWidget;
QVBoxLayout *verticalLayout_2;
QGridLayout *gridLayout;
QLabel *label;
QTextEdit *textEdit;
QLabel *label_2;
QSpinBox *spinBox;
QSpacerItem *verticalSpacer_2;
QGroupBox *groupBox;
QVBoxLayout *verticalLayout;
QRadioButton *radioButton;
QRadioButton *radioButton_2;
QSpacerItem *verticalSpacer;
QHBoxLayout *horizontalLayout;
QSpacerItem *horizontalSpacer;
QPushButton *pushButton;
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(600, 400);
layoutWidget = new QWidget(Dialog);
layoutWidget->setObjectName(QString::fromUtf8("layoutWidget"));
layoutWidget->setGeometry(QRect(30, 10, 543, 391));
verticalLayout_2 = new QVBoxLayout(layoutWidget);
verticalLayout_2->setSpacing(6);
verticalLayout_2->setContentsMargins(11, 11, 11, 11);
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
verticalLayout_2->setContentsMargins(0, 0, 0, 0);
gridLayout = new QGridLayout();
gridLayout->setSpacing(6);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(layoutWidget);
label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
textEdit = new QTextEdit(layoutWidget);
textEdit->setObjectName(QString::fromUtf8("textEdit"));
textEdit->setEnabled(true);
textEdit->setMaximumSize(QSize(487, 20));
gridLayout->addWidget(textEdit, 0, 1, 1, 1);
label_2 = new QLabel(layoutWidget);
label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 1, 0, 1, 1);
spinBox = new QSpinBox(layoutWidget);
spinBox->setObjectName(QString::fromUtf8("spinBox"));
spinBox->setMinimum(1900);
spinBox->setMaximum(2010);
gridLayout->addWidget(spinBox, 1, 1, 1, 1);
verticalLayout_2->addLayout(gridLayout);
verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout_2->addItem(verticalSpacer_2);
groupBox = new QGroupBox(layoutWidget);
groupBox->setObjectName(QString::fromUtf8("groupBox"));
verticalLayout = new QVBoxLayout(groupBox);
verticalLayout->setSpacing(6);
verticalLayout->setContentsMargins(11, 11, 11, 11);
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
radioButton = new QRadioButton(groupBox);
radioButton->setObjectName(QString::fromUtf8("radioButton"));
verticalLayout->addWidget(radioButton);
radioButton_2 = new QRadioButton(groupBox);
radioButton_2->setObjectName(QString::fromUtf8("radioButton_2"));
verticalLayout->addWidget(radioButton_2);
verticalLayout_2->addWidget(groupBox);
verticalSpacer = new QSpacerItem(20, 800, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout_2->addItem(verticalSpacer);
horizontalLayout = new QHBoxLayout();
horizontalLayout->setSpacing(6);
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
horizontalSpacer = new QSpacerItem(458, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout->addItem(horizontalSpacer);
pushButton = new QPushButton(layoutWidget);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
horizontalLayout->addWidget(pushButton);
verticalLayout_2->addLayout(horizontalLayout);
#ifndef QT_NO_SHORTCUT
label->setBuddy(textEdit);
label_2->setBuddy(spinBox);
#endif // QT_NO_SHORTCUT
QWidget::setTabOrder(textEdit, spinBox);
QWidget::setTabOrder(spinBox, radioButton);
QWidget::setTabOrder(radioButton, radioButton_2);
QWidget::setTabOrder(radioButton_2, pushButton);
retranslateUi(Dialog);
QObject::connect(pushButton, SIGNAL(pressed()), Dialog, SLOT(accept()));
QMetaObject::connectSlotsByName(Dialog);
} // setupUi
void retranslateUi(QDialog *Dialog)
{
Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("Dialog", "Name", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("Dialog", "Geburtstag", 0, QApplication::UnicodeUTF8));
groupBox->setTitle(QApplication::translate("Dialog", "Geschlecht", 0, QApplication::UnicodeUTF8));
radioButton->setText(QApplication::translate("Dialog", "M\303\244nnlich", 0, QApplication::UnicodeUTF8));
radioButton_2->setText(QApplication::translate("Dialog", "Weiblich", 0, QApplication::UnicodeUTF8));
pushButton->setText(QApplication::translate("Dialog", "PushButton", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class Dialog: public Ui_Dialog {};
} // namespace Ui
QT_END_NAMESPACE
#endif // DIALOGRW4556_H
Code: Alles auswählen
# -------------------------------------------------
# Project created by QtCreator 2010-08-14T10:42:07
# -------------------------------------------------
TARGET = dialog
TEMPLATE = app
SOURCES += main.cpp \
dialog.cpp \
E:/content/Listings/uiexample/form.cpp
HEADERS += dialog.h \
ui_dialog.h \
form.h
FORMS += dialog.ui
mfg
Ich habe die Datei in den Debug-Ordner gegeben.
Dann kam noch vier mal die selbe Fehlermeldung mit anderen Dateien.
Habe alle hineinkopiert.
Jetzt kommt keine Fehlermeldung mehr wenn ich es direkt starte, aber auch kein Programm.
Wenn ich es vom Qt-Creator aus starte kommt wieder das selbe wie am Anfang:
Rückgabewert -1073741819
Würde eventuell eine Neuinstallation helfen?
mfg
Dann kam noch vier mal die selbe Fehlermeldung mit anderen Dateien.
Habe alle hineinkopiert.
Jetzt kommt keine Fehlermeldung mehr wenn ich es direkt starte, aber auch kein Programm.
Wenn ich es vom Qt-Creator aus starte kommt wieder das selbe wie am Anfang:
Rückgabewert -1073741819
Würde eventuell eine Neuinstallation helfen?
mfg
Du hast 2 Probleme:kannaum hat geschrieben:Ich habe die Datei in den Debug-Ordner gegeben.
Dann kam noch vier mal die selbe Fehlermeldung mit anderen Dateien.
Habe alle hineinkopiert.
Eins:
Dein QtCreator findet deine c++ Zeug nicht, sie scheinen nicht im Pfad zu liegen (sonst hätte die .exe sie dort evtl. gefunden). Das reinkopieren "fehlender" (eigentlich eher: nicht gefundener) Dateien ist keine Lösung, höchsten ein Hack.
Vermutlich fehlen nur die richtigen Pfade - normalerweise setztz das QtSDK die bei der Installation (es sucht/findet deine MinGW und trägt alles ein). Schau dir mal an wie/wo der QtCreator deine c++ Sachen sucht und trag die Pfade evtl nach. Das könnte durch eine Neuinstallation behoben werden.
Zwei:
Dein "Programm" funzt nicht korrekt. Nimm einfach ein Minimalprogramm und behebe Problem Eins, dann kannst du Problem Zwei debuggen und lösen.
(ungetestetes miniprog)
Code: Alles auswählen
#include <QApplication>
#include <QtGui>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QWidget * wid = new QWidget;
QVBoxLayout * lay = new QVBoxLayout;
QLabel * lab = new QLabel ("Testlabel");
lay->addWidget(lab);
wid->setLayout(lay);
wid->show();
return app.exec();
}
Ich habe jetzt Qt neu installiert.
Dein Prgoramm ist ohneProbleme gelaufen.
Jetzt wollte ich mich wieder an den Dialog machen.
Bei der letzten Version konnte ich dann die dialog.ui Datei irgendwo über Bearbeiten ansehen und dann speichern, sodass aus der .ui Datei eine .cpp und eine .h Datei wurde, diese Funktion habe ich jetzt nciht emhr gefunden.
Gibts die noch irgendwo?
Ich weiß, dass das auch irgendwie über die Kommandozeile gehen würde, ich habe aber 0 Ahnung wie.
Ich kapier das einfach nicht
mfg
Dein Prgoramm ist ohneProbleme gelaufen.
Jetzt wollte ich mich wieder an den Dialog machen.
Bei der letzten Version konnte ich dann die dialog.ui Datei irgendwo über Bearbeiten ansehen und dann speichern, sodass aus der .ui Datei eine .cpp und eine .h Datei wurde, diese Funktion habe ich jetzt nciht emhr gefunden.
Gibts die noch irgendwo?
Ich weiß, dass das auch irgendwie über die Kommandozeile gehen würde, ich habe aber 0 Ahnung wie.
Ich kapier das einfach nicht
mfg
Unter Annahme, dass Du QtCreator verwendest... Im Projektbaum (kannst Du mit Alt-0 (english: Alt-x) respektive mit dem halb gefüllten Rechteck an der linken unteren Ecke, links vom "Suchmuster" anzeigen) per Kontextmenü "existierende Datei hinzufügen". Geht natürlich auch von Hand ins .pro... Damit generiert Dir "qt" das moc_xxx.cpp und ui_xxx.h.
Re: Qt Creator: Rückgabewert -1073741819
als Archiv-Info für Suchende:
ggf. fehlen die Pfade zu Qt/bin und MinGW/bin ... siehe: http://qt-project.org/doc/qt-4.8/install-win.html
Step 3: Set the Environment variables
In order to build and use Qt, the PATH environment variable needs to be extended:
PATH - to locate qmake, moc and other Qt tools
This is done by adding c:\Qt\4.8.4\bin to the PATH variable.
For newer versions of Windows, PATH can be extended through the Control Panel|System|Advanced|Environment variables menu.
You may also need to ensure that the locations of your compiler and other build tools are listed in the PATH variable. This will depend on your choice of software development environment.
Note: If you don't use the configured shells, which is available in the application menu, in the Open Source Versions of Qt, configure requires that sh.exe is not in the path or that it is run from msys. This also goes for mingw32-make.
ggf. fehlen die Pfade zu Qt/bin und MinGW/bin ... siehe: http://qt-project.org/doc/qt-4.8/install-win.html
Step 3: Set the Environment variables
In order to build and use Qt, the PATH environment variable needs to be extended:
PATH - to locate qmake, moc and other Qt tools
This is done by adding c:\Qt\4.8.4\bin to the PATH variable.
For newer versions of Windows, PATH can be extended through the Control Panel|System|Advanced|Environment variables menu.
You may also need to ensure that the locations of your compiler and other build tools are listed in the PATH variable. This will depend on your choice of software development environment.
Note: If you don't use the configured shells, which is available in the application menu, in the Open Source Versions of Qt, configure requires that sh.exe is not in the path or that it is run from msys. This also goes for mingw32-make.