[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.
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 -= gui
TARGET = testConsole
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp@
int main(int argc, char *argv)
QCoreApplication a(argc, argv);
Put these files in a directory named testConsole
Open that directory in your console.
Wow!!! Thank you so much!!! Now it is work!!!
Eddy, thank you for your exmaple, but I use qmake-qt4 instead of qmake
, because when I type
it shows me
I don't know how to set environment variables in freebsd to change the path variable, but your solution is fine too. ;)
Have fun with Qt!