PDA

View Full Version : Can't run simplest Qt Project on Ubuntu 8.10 64-bit



rockballad
August 7th, 2009, 02:50 AM
Can't run simplest Qt Project on Ubuntu 8.10 64-bit
Hi all,

I've just installed Qt SDK 2009.03.1 on a fresh Ubuntu machine. That's nice now Qt Creator installed automatically. Then I created a console app to test out the new SDK. First it required g++ and gthread2.0. So I installed g++, libglib2.0-dev to resolve the compiling errors. Then it was compiled successfully. But when I ran it, both in Qt Creator and from commandline (terminal), it didn't seem to run. I had to Ctrl+C or Stop it. Otherwise it would run silently forever. In Creator, it returned a message "The program has unexpectedly finished." Nothing else.


#include <QtCore/QCoreApplication>

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
printf("Hello World!");

return a.exec();
}

Anyone of you have encountered this problem? Please help me out. I'm so confused.

Thanks in advance,

rockballad
August 7th, 2009, 08:26 AM
Oh, someone has solved it out for me. Just comment out the last line, this stuff will run! I'm so surprised at this, because this code is generated by Qt Creator for a simple Console application!

Good day!