Results 1 to 6 of 6

Thread: Need help with basic Qt

  1. #1
    Join Date
    Jul 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Windows

    Default Need help with basic Qt

    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.

    Qt Code:
    1. :: error: [tmp/obj/debug_shared/main.o] Error 1
    To copy to clipboard, switch view to plain text mode 

    Please help

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Need help with basic Qt

    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.

  3. #3
    Join Date
    Jul 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Windows

    Default Re: Need help with basic Qt

    Quote Originally Posted by tbscope View Post
    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.
    Qt Code:
    1. #include <QApplication>
    2. #include <QLabel>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7. QLabel *label = new QLabel("Hello Qt!");
    8. label->show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Need help with basic Qt

    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.

  5. #5
    Join Date
    Jul 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Windows

    Default Re: Need help with basic Qt

    Quote Originally Posted by tbscope View Post
    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.

  6. #6
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Need help with basic Qt

    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

Similar Threads

  1. Need basic help
    By Ossi in forum Qwt
    Replies: 2
    Last Post: 23rd October 2009, 13:24
  2. Basic Points of QT
    By BalaQT in forum Newbie
    Replies: 1
    Last Post: 14th August 2009, 06:39
  3. Qt/embedded Basic
    By nrabara in forum Newbie
    Replies: 3
    Last Post: 20th November 2008, 17:27
  4. Need immediate help on basic cpp
    By Sandip in forum General Programming
    Replies: 10
    Last Post: 21st September 2008, 10:33
  5. Qt/C++ basic Q-s
    By jamadagni in forum General Programming
    Replies: 9
    Last Post: 10th February 2006, 08:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.