[ enaB @ 19.11.2007. 13:09 ] @
Kaže:

Citat:
Here’s a very simple Qt program:
001 #include <qapplication.h>
002 #include <qlabel.h>
003 int main(int argc, char *argv[])
004 {
005 QApplication app(argc, argv);
006 QLabel *label = new QLabel("Hello Qt!", 0);
007 app.setMainWidget(label);
008 label->show();
009 return app.exec();
010 }


Citat:
You will also need the Hello program.s source code in a file called hello.cpp in
a directory called hello.You can type in hello.cpp yourself, or copy it from the
CD provided with this book, where it is available as \examples\chap01\hello\
hello.cpp.

From a command prompt, change directory to hello, then type

qmake -project

to create a platform-independent project file (hello.pro), then type

qmake hello.pro

to create a platform-specific makefile from the project file. Run make to build
the program, and run the program by typing hello on Windows, ./hello on
Unix, and open hello.app on Mac OS X.


Uradim tako, ukucam
./hello
ali program neće da se pokrene. Ništa se ne dešava.
btw. Program je executable.
U čemu je problem?
[ Chipa @ 26.11.2007. 14:21 ] @
Pokrenuo se i zavrsio je :) Probaj doticni primer sa QPushButton-om, QLabel je malo nezgodan po tom pitanju. No opsta preporuka je da batalis Qt3 posto je on vec istorija i koristis Qt4, tamo stvari izgledaju malo drugacije sto se tice QApplication-a.