Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling Qt application on Linux without X

In a company we have a developer server with all the necessary stuff for coding. Among others, there is a Jenkins CI tool installed and working.

Now I want to configure it to be able to build Qt5.5 application. The problem is that there are no X11 on the server - only console access.

Is it possible to build a Qt application on a platform like that? I can't even install Qt5.5 framework because of lack of the GUI. But maybe I can somehow install only required libraries and qmake?

like image 786
SP5RFD Avatar asked Mar 10 '26 09:03

SP5RFD


1 Answers

Yes, it's fine (to quote your question) to "build a Qt application on a platform like that", "installing only only required libraries and qmake".

Installing the libs will not drag a full GUI environment - else your distribution's package dependency system is seriously flawed.

What you do not state and is important too is if you want to be able to run a Qt application on such a platform without GUI (as opposed to "just for the jenkins build").

If this is the case, this is still possible, installing only Qt core: you'll have all the benefits of Qt's object framework, without the GUI parts. This will be a Qt console app, which is perfectly doable and legitimate.

You do not tell us what's the distribution installed on this machine, but for instance on my Debian this is the libqt5core5a - Qt 5 core module package:

$ apt-cache show libqt5core5a

...

Depends: libc6 (>= 2.15), libgcc1 (>= 1:4.1.1), libglib2.0-0 (>= 2.22.0), libicu55 (>= 55.1-1~), libpcre16-3, libstdc++6 (>= 4.9), zlib1g (>= 1:1.1.4)

...

Description-en: Qt 5 core module Qt is a cross-platform C++ application framework. Qt's primary feature is its rich set of widgets that provide standard GUI functionality.

The QtCore module contains core non-GUI functionality.

...

As you can see:

  • This depends on nothing GUI related.

  • This only contains core non-GUI functionality.

like image 73
jbm Avatar answered Mar 13 '26 02:03

jbm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!