I have been looking into the use of Qt for C++ developing applications on Linux and have read through most of the book “C++ GUI programming with Qt4”. This is great for applications that need a front end, but now I have a requirement to write a C++ command line only application but using some of the Qt networking and socket classes. It has to be command line only as it will run on a host machine that runs command line only install of Ubuntu. In my book I can find absolutely no reference at all to going down this route – everything is described with GUI in mind.
Basically all I need is a yes/no answer (although a pointer to how to start would also be very welcome) as to whether I can use Qt to create a command line only application?? Many thanks.
Yes, you will need this in your qmake pro file:
which will link only to QtCore, and this essential
maincode:There are several other Qt libraries you can use, like QtNetwork, because they do not depend on QtGui. Check the documentation to find out more.