Results 1 to 10 of 10

Thread: Getting Started

  1. #1

    Default Getting Started

    I've poke around the forums and Googled on getting started with Qt. When I initially downloaded I was under the impression it also came with an IDE. However now it appears it's everything BUT the IDE. This is OK because I am already familiar with Visual Studio although I no longer develop using it, instead I prefer to use UltraEdit for all my web development needs.

    I am interested in picking up some C++ again but wanted cross platform and decided to try Qt out.

    Can someone point me in the direction in just getting started setting up the proper tool chain required to compile a basic Widget window?

    It sounds like I use qmake to generate a project file and that project file will invoke all the proper tools in order to generate an executable?

    I'm using the OSS version so I am using the MinGW compiler. I've looked at the CLI for the Gnu tools and I am sure I could begin stringing togather an application by compiling/linking each source file manually but what a PITA.

    Using the given toolset, what would be the best way to begin?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting Started

    Quote Originally Posted by Hockey View Post
    It sounds like I use qmake to generate a project file and that project file will invoke all the proper tools in order to generate an executable?
    qmake generates makefiles from much simplier .pro files with all of the rules that Qt needs for compilation.

    Quote Originally Posted by Hockey View Post
    Using the given toolset, what would be the best way to begin?
    Read this:
    http://doc.trolltech.com/4.3/tutorial.html
    http://doc.trolltech.com/4.3/qmake-tutorial.html
    http://doc.trolltech.com/4.3/designe...component.html

  3. #3

    Default Re: Getting Started

    Thanks for the speedy reply.

    I've read those articles and tried to build a simple, single file application but I am getting the following error:

    Qt Code:
    1. mingw32-make: *** No rule to make target `test.pro', needed by `Makefile'. Stop.
    To copy to clipboard, switch view to plain text mode 

    What am I doing wrong? I've Googled but nothing really helpful.

    Cheers

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting Started

    How does your .pro file look like and what how did you invoke qmake?

  5. #5

    Default Re: Getting Started

    Edit It just occured to me to look inside my makefile and see if the path were inside the makefile. It seems as though the makefile is just referencing the test.pro and NOT including the path. Ise the environment variables for the MinGW and Qt binaries, do I just add my project path to environment variables as well? I would need to keep the path in the qmake command thought, correct?

    This is the contents of my project file:

    Qt Code:
    1. CONFIG += qt
    2. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

    I copied it verbatim essentially from the tutorials...

    I invoked qmake with this command:

    Qt Code:
    1. qmake.exe -o c:\test\Makefile c:\test\test.pro
    To copy to clipboard, switch view to plain text mode 
    Last edited by Hockey; 29th November 2007 at 21:13.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting Started

    Everything OK so far. How did you invoke make?

  7. #7

    Default Re: Getting Started

    Qt Code:
    1. make --makefile=c:\test\Makefile
    To copy to clipboard, switch view to plain text mode 

    I've tried several switches but no luck...

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting Started

    Does it work if you invoke:
    Qt Code:
    1. cd c:\test\
    2. make
    To copy to clipboard, switch view to plain text mode 
    ?

  9. #9

    Default Re: Getting Started

    Zing!!!

    That did the trick. Although it compiled as release not debug. Does this mean I have too add my project path to environment variables?

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting Started

    Quote Originally Posted by Hockey View Post
    That did the trick. Although it compiled as release not debug.
    Most likely it's because you don't have the debug version of Qt libraries. Look for "Build Qt libraries in debug mode" or something similar in the Start menu.

    Quote Originally Posted by Hockey View Post
    Does this mean I have too add my project path to environment variables?
    No, I've just reproduced your problem on my system. It seems that qmake generates Makefiles which expect that the .pro file is in the current directory. So you just have to make sure that your project's directory is the current one.

Similar Threads

  1. Replies: 2
    Last Post: 30th March 2007, 08:10
  2. Replies: 10
    Last Post: 20th March 2007, 22:19
  3. How do I get started?
    By neigaard in forum Newbie
    Replies: 2
    Last Post: 12th March 2007, 08:42
  4. Replies: 10
    Last Post: 7th April 2006, 18:23

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.