Results 1 to 3 of 3

Thread: very newbie, where/how make .pro files?

  1. #1
    Join Date
    Nov 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default very newbie, where/how make .pro files?

    Ok I'm very new and I don't understand what .pro files are for, or where to actually make them.
    I'm trying to do the qmake tutorial http://doc.qt.nokia.com/4.7/qmake-tutorial.html and I don't know what it's talking about when it says to make the project file:

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

    am I supposed to write this in Microsoft visual studio and save it as a .pro file within the project? Or do I write this in a plain text file and save it where the hello.h and hello.cpp files are?

    I am confused, please help!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: very newbie, where/how make .pro files?

    The PRO file tells qmake how to generate the necessary files to build you project. Those files may take the form of a Makefile or a Visual Studio project file.

    The answers to your questions are:
    am I supposed to write this in Microsoft visual studio and save it as a .pro file within the project?
    Yes, if that is your favourite text editor.
    Or do I write this in a plain text file and save it where the hello.h and hello.cpp files are?
    Yes. It is a plain text file. As the docs say it should live in the same directory as the sources.

    From the third paragraph of the document you linked:
    You will find these files in the examples/qmake/tutorial directory of the Qt distribution. The only other thing you know about the setup of the application is that it's written in Qt. First, using your favorite plain text editor, create a file called hello.pro in examples/qmake/tutorial. The first thing you need to do is add the lines that tell qmake about the source and header files that are part of your development project.

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

    kja (15th November 2010)

  4. #3
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: very newbie, where/how make .pro files?

    Hi futes,

    Just use QtCreator. It will get you started with Qt a lot faster, as it takes care of all these things like creating the .pro file and calling qmake and everything.
    You can download prebuild versions of the Qt SDK both for Visual Studio (it must already be on your computer) and for MingW (this gets installed automatically) and they both work with QtCreator.

    Best regards,
    Marc

Similar Threads

  1. Replies: 6
    Last Post: 10th March 2011, 16:42
  2. Replies: 4
    Last Post: 18th April 2010, 00:37
  3. Extracting text from files (AKA I'm a newbie!)
    By mike phillips in forum Newbie
    Replies: 16
    Last Post: 30th January 2009, 17:27
  4. How to manage files with different folders for make
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 7th July 2007, 13:44
  5. How to make .pro files
    By merry in forum Newbie
    Replies: 2
    Last Post: 8th March 2007, 20:46

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
  •  
Qt is a trademark of The Qt Company.