Results 1 to 7 of 7

Thread: qmake and QtNetwork

  1. #1
    Join Date
    Jan 2009
    Posts
    78
    Thanks
    21
    Thanked 1 Time in 1 Post

    Default qmake and QtNetwork

    Hi

    I was looking at Broadcast Sender Example ( http://doc.trolltech.com/4.3/network...astsender.html ).

    Then i got the error: Qt Network ... no such file or directory.

    I opened the .pro and added QT += network and it compiled fine.

    The question is: Does qmake have an option to do this automatically?

    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qmake and QtNetwork

    I use the following set of commands for the "Rebuild All" command in VS C++:

    Qt Code:
    1. qmake -project
    2. qmake "QT += network"
    3. nmake release-clean
    4. nmake release
    To copy to clipboard, switch view to plain text mode 

    I.e., I just pass the "QT += network" to the qmake command

    Hope this helps!

    Cheers,

    bootsector

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake and QtNetwork

    Quote Originally Posted by gt.beta2 View Post
    The question is: Does qmake have an option to do this automatically
    No, it doesn't. If it did, the statement would not be required at all. But that's not much work to add it to your project file, is it?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Jan 2009
    Posts
    78
    Thanks
    21
    Thanked 1 Time in 1 Post

    Default Re: qmake and QtNetwork

    Then i guess that the Qt Creator option to include this or that module does something so simple as adding this lines to the .pro. Right?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake and QtNetwork

    Yes, that's exactly what it does.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake and QtNetwork

    Well, in fact there is a way to do this, but it is not the one I would suggest.

    If you go to you $QTDIR/mkspecs/<your_spec> you will see qmake.conf file which will probably have this line
    Qt Code:
    1. QT += core gui
    To copy to clipboard, switch view to plain text mode 

    You might want to add all the libs that you need. Let's say you add 'network' to QT. So you have
    Qt Code:
    1. QT += core gui network
    To copy to clipboard, switch view to plain text mode 

    But, if you create another projects they will include this module even if you don't need it.
    I'm a rebel in the S.D.G.

  7. #7
    Join Date
    Jan 2009
    Posts
    78
    Thanks
    21
    Thanked 1 Time in 1 Post

    Default Re: qmake and QtNetwork

    It's easier to edit the project.pro file

    Thanks

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.