Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]Qt and FreeBSD
Forum Update on Tuesday, May 27th 2025

[Solved]Qt and FreeBSD

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 8.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mafiozzi
    wrote on 2 Aug 2011, 19:29 last edited by
    #1

    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!

    You have exactly five minutes to win
    Or a lifetime to forget if you don't

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on 2 Aug 2011, 19:49 last edited by
      #2

      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.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on 2 Aug 2011, 20:07 last edited by
        #3

        It is possible, but by default a qmake based project will include QtGui.

        Try adding @QT -= gui@ to your .pro file.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mafiozzi
          wrote on 3 Aug 2011, 03:53 last edited by
          #4

          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".

          You have exactly five minutes to win
          Or a lifetime to forget if you don't

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mlong
            wrote on 3 Aug 2011, 04:15 last edited by
            #5

            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!

            Software Engineer
            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

            1 Reply Last reply
            0
            • E Offline
              E Offline
              Eddy
              wrote on 3 Aug 2011, 09:02 last edited by
              #6

              I just made a test project in QT Creator, so you can test your installation.

              testConsole.pro

              @QT += core
              QT -= gui

              TARGET = testConsole
              CONFIG += console
              CONFIG -= app_bundle

              TEMPLATE = app
              SOURCES += main.cpp@

              main.cpp
              @#include <QtCore/QCoreApplication>

              int main(int argc, char *argv[])
              {
              QCoreApplication a(argc, argv);

              return a.exec&#40;&#41;;
              

              }@

              Put these files in a directory named testConsole
              Open that directory in your console.

              then do
              qmake
              make

              Qt Certified Specialist
              www.edalsolutions.be

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mafiozzi
                wrote on 3 Aug 2011, 16:38 last edited by
                #7

                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
                @qmake -v@
                it shows me
                @...version 3.xxx@

                You have exactly five minutes to win
                Or a lifetime to forget if you don't

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  Eddy
                  wrote on 3 Aug 2011, 16:50 last edited by
                  #8

                  You're welcome.

                  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!

                  Qt Certified Specialist
                  www.edalsolutions.be

                  1 Reply Last reply
                  0

                  1/8

                  2 Aug 2011, 19:29

                  • Login

                  • Login or register to search.
                  1 out of 8
                  • First post
                    1/8
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved