PDA

View Full Version : Need help with basic Qt



doforumda
10th July 2010, 06:14
hi i am new to qt and following this book "C++ GUI Programming with Qt4 2nd Edition". I just started this book. When i try Hello Qt example in that book it gives me this error.


:: error: [tmp/obj/debug_shared/main.o] Error 1

Please help

tbscope
10th July 2010, 08:24
Please post your code and the complete error.
The line you posted only states that there is an error in main.o, but not what the error is.

doforumda
10th July 2010, 08:46
Please post your code and the complete error.
The line you posted only states that there is an error in main.o, but not what the error is.



#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}

tbscope
10th July 2010, 08:58
That code looks ok (at first sight).

Can you post the complete error please?
I guess it's a linker error which means it might be possible that certain components can't be found.

If you use Qt Creator, the complete error can be found in the compile or build tab at the bottom.

doforumda
10th July 2010, 09:44
That code looks ok (at first sight).

Can you post the complete error please?
I guess it's a linker error which means it might be possible that certain components can't be found.

If you use Qt Creator, the complete error can be found in the compile or build tab at the bottom.

It is working now. thanks for your help. yes i am using Qt Creater. I am new to the world of Qt and Qt Creater. Can please suggest the best place of Qt creater not Qt but Qt creater. I am alittle confuse with this Qt creater. In the book they dont say how to make apps using Qt creater they gave example and say run it.

tbscope
10th July 2010, 09:53
As far as I know, the book was written before Qt Creator was released.
But you can find information on this page: http://doc.qt.nokia.com/qtcreator-2.0/index.html