THe following little Qt program crashes on my gentoo qt-4.3.1 box. I really need some help finding out what casues it.
Any ideas anyone?
------------------------
test_project.pro:
TEMPLATE = app
LANGUAGE = C++
OBJECTS_DIR = ./build
MOC_DIR = ./build
DESTDIR = ./
CONFIG += qt warn_on release thread
SOURCES += main.cpp\
TEMPLATE = app
LANGUAGE = C++
OBJECTS_DIR = ./build
MOC_DIR = ./build
DESTDIR = ./
CONFIG += qt warn_on release thread
SOURCES += main.cpp\
To copy to clipboard, switch view to plain text mode
---------------------------------
main.cpp:
#include <QApplication>
#include <QFileDialog>
#include <QMessageBox>
int main(int argc, char *argv[])
{
QMessageBox::information(0,
"test",
"You selected file: "+fname
);
return 0;
}
#include <QApplication>
#include <QFileDialog>
#include <QMessageBox>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QString fname = QFileDialog::getOpenFileName(0, QString("Open file"), "");
QMessageBox::information(0,"test","You selected file: "+fname);
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks