[Solved]Qt and FreeBSD
-
Good day, every one!
I'm trying to install and use Qt on FreeBSD without any windows system, only command line.
I've installed Qt, and when I'm trying to build small test application (hello world), and I'm getting nothing but errors.
I'm not going to tell you about erros I've got, I just want to know, is it really possible to use Qt without any GUI?
I want to build some command line applications.Thanks you all!
-
Yes, it's absolutely possible.
While I can't imagine why you'd want to withhold the errors you're getting (because nobody likes trying to read your mind and make wild guesses as what's wrong) I'll throw out a couple of things.
Make sure you're using QCoreApplication instead of QApplication, and in your .pro file, make sure you have the line
@
QT -= gui
@Anything else, and you're on your own unless you care to share more.
-
It is possible, but by default a qmake based project will include QtGui.
Try adding @QT -= gui@ to your .pro file.
-
Good morning!
bq. While I can’t imagine why you’d want to withhold the errors you’re getting (because nobody likes trying to read your mind and make wild guesses as what’s wrong)
mlong, I'm really sorry for that. I'm a newcomer in Qt and I'm a newcomer FreeBSD, in other words - I'm a totaly newcomer. There is a lot errors I've got, so first I thought "May be it is impossible".
-
No worries. Don't worry about being a newcomer. There are people of all skill levels around here, all of whom have been beginners at one point or another. Don't be afraid to give any pertinent information when you have a problem!
I hope the above suggestions helped in getting a command line app running. If not, check back in and we'll make sure you get the help you need!
Have fun, and welcome!
-
I just made a test project in QT Creator, so you can test your installation.
@QT += core
QT -= guiTARGET = testConsole
CONFIG += console
CONFIG -= app_bundleTEMPLATE = app
SOURCES += main.cpp@main.cpp
@#include <QtCore/QCoreApplication>int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);return a.exec();
}@
Put these files in a directory named testConsole
Open that directory in your console.then do
qmake
make