Results 1 to 3 of 3

Thread: How to make .pro files

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default How to make .pro files

    Hi all

    I m using Qt3.1(Linux Operating System) and tried to make Simple Hello Word Program. with the filename hello.cpp

    Here the code is:

    Qt Code:
    1. #include <qapplication.h>
    2. #include <qpushbutton.h>
    3.  
    4. int main( int argc,char **argv )
    5. {
    6. QApplication a( argc, arg v);
    7.  
    8. QPushButton hello( "Hello World!",0);
    9. hello.resize( 100, 30);
    10. a.setMainWidget( &hello );
    11. hello.show();
    12. return a.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 

    when i write qmake hello.cpp at commad line

    i got:

    [root@localhost root]# qmake hello.cpp
    hello.cpp:4: Unknown test function: int main
    hello.cpp:6: Unknown test function: QApplication a
    hello.cpp:8: Unknown test function: QPushButton hello
    hello.cpp:9: Unknown test function: hello.resize
    hello.cpp:10: Unknown test function: a.setMainWidget
    hello.cpp:11: Unknown test function: hello.show
    hello.cpp:12: Unknown test function: return a.exec

    What it mean and what should I do?
    or For this I have to make pro file
    if yes then Plese Tell me how can I make pro files


    Thanx

    Merry
    Last edited by wysota; 8th March 2007 at 10:31. Reason: missing [code] tags
    Always Believe in Urself
    Merry

  2. #2
    Join Date
    Jan 2006
    Posts
    128
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make .pro files

    Quote Originally Posted by merry View Post
    I m using Qt3.1(Linux Operating System)
    Why do you use Qt 3.1? If there is not strong reason for it I would suggest going with Qt 4.x as it is more future proof ;-)

    Quote Originally Posted by merry View Post
    when i write qmake hello.cpp at commad line
    I would suggest reading the qmake user guide as you seem to have the wrong idea about what qmake is.

    To quote the above linked manual:
    qmake is a tool created by Trolltech to write makefiles for different compilers and platforms.
    So you would not call it with implementation files directly. If you do not want to read the whole manual, read the 10 minute guide to using qmake which should hopefully tell you how to get the result you desire ;-)



    Good Luck :-)

  3. The following user says thank you to camel for this useful post:

    merry (8th March 2007)

  4. #3
    Join Date
    Feb 2007
    Posts
    73
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make .pro files

    Yes you should review the qmake documentation. But a quick answer is:

    cd <development directory>
    qmake -project [-o <optional name of project file>]
    qmake
    make

  5. The following user says thank you to smacchia for this useful post:

    merry (9th March 2007)

Similar Threads

  1. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  2. Replies: 5
    Last Post: 22nd September 2006, 08:04
  3. make install with debug_and_release_target
    By aba in forum Qt Programming
    Replies: 0
    Last Post: 17th April 2006, 19:28
  4. [Win32/VC++ 8.0] Strange problems with qrc_*.cpp files
    By mloskot in forum Installation and Deployment
    Replies: 6
    Last Post: 6th March 2006, 10:28
  5. Visual Studio 2003 and .vcproj files
    By mbjerkne in forum General Discussion
    Replies: 2
    Last Post: 1st February 2006, 00:51

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.