PDA

View Full Version : qmake and QtNetwork



gt.beta2
6th March 2009, 21:13
Hi

I was looking at Broadcast Sender Example ( http://doc.trolltech.com/4.3/network-broadcastsender.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

bootsector
6th March 2009, 23:13
I use the following set of commands for the "Rebuild All" command in VS C++:


qmake -project
qmake "QT += network"
nmake release-clean
nmake release

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

Hope this helps!

Cheers,

bootsector

wysota
7th March 2009, 09:07
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?

gt.beta2
7th March 2009, 10:14
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?

wysota
7th March 2009, 12:15
Yes, that's exactly what it does.

lyuts
14th March 2009, 12:13
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 += core gui


You might want to add all the libs that you need. Let's say you add 'network' to QT. So you have


QT += core gui network


But, if you create another projects they will include this module even if you don't need it.

gt.beta2
14th March 2009, 23:46
It's easier to edit the project.pro file :)

Thanks