How to build Qt on system without a GUI?



  • Hi everyone!
    I have the Analog devices board with ARMv7 and there isn't any GUI (I working througth SSH) so i'm getting a lot of errors if i follow this https://doc.qt.io/qt-5/linux-building.html .
    How can I build Qt on this device? I need latest Qt.
    I already lost the second day with this problem(((
    Thank you so much for any help! And sorry for my English, i'm just studing)))



  • Tell us a bit more. Are you trying to cross compile Qt for ARMv7 or are you building Qt on the device itself?
    What errors do you get? Please show us your configure command.



  • I'm building on the device itself.
    Latest configure commands:

    ./configure -opensource \
        -confirm-license \
        -nomake examples \
        -skip qtquickcontrols \
        -skip qtwebkit \
        -skip qtwebchannel \
        -skip qtactiveqt \
        -skip qtandroidextras \
        -skip qtdeclarative \
        -skip qtimageformats \
        -skip qtmacextras \
        -skip qtx11extras \
        -skip qtxmlpatterns \
        -skip qtconnectivity \
        -skip qtdoc \
        -skip qtenginio \
        -skip qtgraphicaleffects \
        -skip qtmultimedia \
        -skip qtquick1 \
        -skip qtsensors \
        -skip qttools \
        -skip qttranslations \
        -skip qtwayland \
        -skip qtwebchannel \
        -skip qtwebengine \
        -skip qtwebkit-examples \
        -skip qtwebsockets \
        -skip qtwinextras \
        -verbose \
        -no-gif \
        -no-libjpeg \
        -no-mtdev \
        -no-sql-db2 \
        -no-sql-ibase \
        -no-sql-mysql \
        -no-xcb \
        -qt-freetype \
        -no-fontconfig \
        -no-harfbuzz \
        -no-xinput2 \
        -no-xcb-xlib \
        -no-pulseaudio \
        -no-alsa \
        -no-gtkstyle \
        -no-nis \
        -no-cups \
        -no-iconv \
        -no-icu \
        -no-eglfs 
    

    Then i did "make -j 2" (there is 2 cores) and in about hourse i got this:

    e/QtGui -I../../../../include/QtCore/5.13.0 -I../../../../include/QtCore/5.13.0/QtCore -I../../../../include/QtCore -I.moc -isystem /usr/include/libdrm -I../../../../mkspecs/linux-g++ -o .obj/qcomposeplatforminputcontext.o qcomposeplatforminputcontext.cpp
    In file included from qcomposeplatforminputcontext.cpp:39:0:
    qcomposeplatforminputcontext.h:46:41: fatal error: xkbcommon/xkbcommon-compose.h: No such file or directory
     #include <xkbcommon/xkbcommon-compose.h>
                                             ^
    compilation terminated.
    make[5]: *** [.obj/qcomposeplatforminputcontext.o] Error 1
    make[5]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src/plugins/platforminputcontexts/compose'
    make[4]: *** [sub-compose-make_first] Error 2
    make[4]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src/plugins/platforminputcontexts'
    make[3]: *** [sub-platforminputcontexts-make_first] Error 2
    make[3]: *** Waiting for unfinished jobs....
    g++ -c -pipe -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wno-missing-field-initializers -D_REENTRANT -fPIC -DQT_NO_FOREACH -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SERVICE_SUPPORT_LIB -DQT_THEME_SUPPORT_LIB -DQT_FB_SUPPORT_LIB -DQT_EVENTDISPATCHER_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_INPUT_SUPPORT_LIB -DQT_GUI_LIB -DQT_DEVICEDISCOVERY_SUPPORT_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I. -I../../../../include -I../../../../include/QtServiceSupport -I../../../../include/QtServiceSupport/5.13.0 -I../../../../include/QtServiceSupport/5.13.0/QtServiceSupport -I../../../../include/QtThemeSupport -I../../../../include/QtThemeSupport/5.13.0 -I../../../../include/QtThemeSupport/5.13.0/QtThemeSupport -I../../../../include/QtFbSupport -I../../../../include/QtFbSupport/5.13.0 -I../../../../include/QtFbSupport/5.13.0/QtFbSupport -I../../../../include/QtEventDispatcherSupport -I../../../../include/QtEventDispatcherSupport/5.13.0 -I../../../../include/QtEventDispatcherSupport/5.13.0/QtEventDispatcherSupport -I../../../../include/QtFontDatabaseSupport -I../../../../include/QtFontDatabaseSupport/5.13.0 -I../../../../include/QtFontDatabaseSupport/5.13.0/QtFontDatabaseSupport -I../../../../include/QtInputSupport -I../../../../include/QtInputSupport/5.13.0 -I../../../../include/QtInputSupport/5.13.0/QtInputSupport -I../../../../include/QtGui/5.13.0 -I../../../../include/QtGui/5.13.0/QtGui -I../../../../include/QtGui -I../../../../include/QtDeviceDiscoverySupport -I../../../../include/QtDeviceDiscoverySupport/5.13.0 -I../../../../include/QtDeviceDiscoverySupport/5.13.0/QtDeviceDiscoverySupport -I../../../../include/QtCore/5.13.0 -I../../../../include/QtCore/5.13.0/QtCore -I../../../../include/QtNetwork -I../../../../include/QtDBus -I../../../../include/QtCore -I.moc -isystem /usr/include/libdrm -I../../../../mkspecs/linux-g++ -o .obj/moc_qvnc_p.o .moc/moc_qvnc_p.cpp
    g++ -c -pipe -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wno-missing-field-initializers -D_REENTRANT -fPIC -DQT_NO_FOREACH -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SERVICE_SUPPORT_LIB -DQT_THEME_SUPPORT_LIB -DQT_FB_SUPPORT_LIB -DQT_EVENTDISPATCHER_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_INPUT_SUPPORT_LIB -DQT_GUI_LIB -DQT_DEVICEDISCOVERY_SUPPORT_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I. -I../../../../include -I../../../../include/QtServiceSupport -I../../../../include/QtServiceSupport/5.13.0 -I../../../../include/QtServiceSupport/5.13.0/QtServiceSupport -I../../../../include/QtThemeSupport -I../../../../include/QtThemeSupport/5.13.0 -I../../../../include/QtThemeSupport/5.13.0/QtThemeSupport -I../../../../include/QtFbSupport -I../../../../include/QtFbSupport/5.13.0 -I../../../../include/QtFbSupport/5.13.0/QtFbSupport -I../../../../include/QtEventDispatcherSupport -I../../../../include/QtEventDispatcherSupport/5.13.0 -I../../../../include/QtEventDispatcherSupport/5.13.0/QtEventDispatcherSupport -I../../../../include/QtFontDatabaseSupport -I../../../../include/QtFontDatabaseSupport/5.13.0 -I../../../../include/QtFontDatabaseSupport/5.13.0/QtFontDatabaseSupport -I../../../../include/QtInputSupport -I../../../../include/QtInputSupport/5.13.0 -I../../../../include/QtInputSupport/5.13.0/QtInputSupport -I../../../../include/QtGui/5.13.0 -I../../../../include/QtGui/5.13.0/QtGui -I../../../../include/QtGui -I../../../../include/QtDeviceDiscoverySupport -I../../../../include/QtDeviceDiscoverySupport/5.13.0 -I../../../../include/QtDeviceDiscoverySupport/5.13.0/QtDeviceDiscoverySupport -I../../../../include/QtCore/5.13.0 -I../../../../include/QtCore/5.13.0/QtCore -I../../../../include/QtNetwork -I../../../../include/QtDBus -I../../../../include/QtCore -I.moc -isystem /usr/include/libdrm -I../../../../mkspecs/linux-g++ -o .obj/moc_qvncclient.o .moc/moc_qvncclient.cpp
    g++ -c -pipe -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wno-missing-field-initializers -D_REENTRANT -fPIC -DQT_NO_FOREACH -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SERVICE_SUPPORT_LIB -DQT_THEME_SUPPORT_LIB -DQT_FB_SUPPORT_LIB -DQT_EVENTDISPATCHER_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_INPUT_SUPPORT_LIB -DQT_GUI_LIB -DQT_DEVICEDISCOVERY_SUPPORT_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I. -I../../../../include -I../../../../include/QtServiceSupport -I../../../../include/QtServiceSupport/5.13.0 -I../../../../include/QtServiceSupport/5.13.0/QtServiceSupport -I../../../../include/QtThemeSupport -I../../../../include/QtThemeSupport/5.13.0 -I../../../../include/QtThemeSupport/5.13.0/QtThemeSupport -I../../../../include/QtFbSupport -I../../../../include/QtFbSupport/5.13.0 -I../../../../include/QtFbSupport/5.13.0/QtFbSupport -I../../../../include/QtEventDispatcherSupport -I../../../../include/QtEventDispatcherSupport/5.13.0 -I../../../../include/QtEventDispatcherSupport/5.13.0/QtEventDispatcherSupport -I../../../../include/QtFontDatabaseSupport -I../../../../include/QtFontDatabaseSupport/5.13.0 -I../../../../include/QtFontDatabaseSupport/5.13.0/QtFontDatabaseSupport -I../../../../include/QtInputSupport -I../../../../include/QtInputSupport/5.13.0 -I../../../../include/QtInputSupport/5.13.0/QtInputSupport -I../../../../include/QtGui/5.13.0 -I../../../../include/QtGui/5.13.0/QtGui -I../../../../include/QtGui -I../../../../include/QtDeviceDiscoverySupport -I../../../../include/QtDeviceDiscoverySupport/5.13.0 -I../../../../include/QtDeviceDiscoverySupport/5.13.0/QtDeviceDiscoverySupport -I../../../../include/QtCore/5.13.0 -I../../../../include/QtCore/5.13.0/QtCore -I../../../../include/QtNetwork -I../../../../include/QtDBus -I../../../../include/QtCore -I.moc -isystem /usr/include/libdrm -I../../../../mkspecs/linux-g++ -o .obj/main.o main.cpp
    rm -f libqvnc.so
    g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../../lib -shared -o libqvnc.so .obj/main.o .obj/qvncintegration.o .obj/qvncscreen.o .obj/qvnc.o .obj/qvncclient.o .obj/moc_qvncscreen.o .obj/moc_qvnc_p.o .obj/moc_qvncclient.o  /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5ServiceSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5ThemeSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5FbSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5EventDispatcherSupport.a /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so /usr/lib/arm-linux-gnueabihf/libglib-2.0.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5FontDatabaseSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libqtfreetype.a /usr/lib/arm-linux-gnueabihf/libpng12.so /usr/lib/arm-linux-gnueabihf/libz.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5InputSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5Gui.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5DeviceDiscoverySupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5Network.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5DBus.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5Core.so /usr/lib/arm-linux-gnueabihf/libGL.so -lpthread
    mv -f libqvnc.so ../../../../plugins/platforms/libqvnc.so
    make[5]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src/plugins/platforms/vnc'
    make[4]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src/plugins/platforms'
    make[3]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src/plugins'
    make[2]: *** [sub-plugins-make_first] Error 2
    make[2]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src'
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase'
    make: *** [module-qtbase-make_first] Error 2
    analog@analog:~/qt-everywhere-src-5.13.0$
    
    

  • Lifetime Qt Champion

    Hi,

    While you don't need a screen to build Qt, you still need the development libraries required for the various features you want to build.



  • @SGaist This configure options i just copied from somewhere)) I need just features like from qt5-default (this one i can install with apt, but only old version) and networking


  • Lifetime Qt Champion

    You need the libxkbcommon development package.



  • @SGaist But xcb need for windows system. My dev board hasn't windows system))
    I need to build only QtCore and QNetwork



  • https://forum.qt.io/topic/45821/building-minimal-qt5-no-gui-just-qtcore-qtnetwork-oh-and-qtscript-solved/2
    This man had like problem. He wrote that built qtbase, bu HOW??? I can't find info about it on network



  • @BrMisha said in How to build Qt on system without a GUI?:

    fatal error: xkbcommon/xkbcommon-compose.h: No such file or directory

    Like @SGaist said, you need the libraries anyway. Check Qt5 Dependencies page.
    Try this maybe?

    sudo apt-get install libx11-xcb-dev libglu1-mesa-dev build-dependencies
    

    If not solves, try this,

    sudo apt-get install libxcb1 libxcb-util0 libpam-dev libcairo-dev libxcb-xinerama0 libev-dev libx11-dev libx11-xcb-dev libxkbcommon0 libxkbcommon-x11-dev libxkbcommon-dev libxcb-dpms0-dev libxcb-xinerama0-dev libxkbfile-dev libxcb-util0-dev libxcb-image0-dev
    

  • Lifetime Qt Champion

    @BrMisha said in How to build Qt on system without a GUI?:

    https://forum.qt.io/topic/45821/building-minimal-qt5-no-gui-just-qtcore-qtnetwork-oh-and-qtscript-solved/2
    This man had like problem. He wrote that built qtbase, bu HOW??? I can't find info about it on network

    Run the configure script that is located in qtbase.

    As for xkbcommon, you can also disable that feature.



  • @closx said in How to build Qt on system without a GUI?:

    libraries
    I installed this libs and started make. Now waiting a few hours ))) (it's quit slow)



  • @SGaist so, i have done it but got this output:

    rm -f libqvnc.so
    g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../../lib -shared -o libqvnc.so .obj/main.o .obj/qvncintegration.o .obj/qvncscreen.o .obj/qvnc.o .obj/qvncclient.o .obj/moc_qvncscreen.o .obj/moc_qvnc_p.o .obj/moc_qvncclient.o  /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5ServiceSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5ThemeSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5FbSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5EventDispatcherSupport.a /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so /usr/lib/arm-linux-gnueabihf/libglib-2.0.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5FontDatabaseSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libqtfreetype.a /usr/lib/arm-linux-gnueabihf/libpng12.so /usr/lib/arm-linux-gnueabihf/libz.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5InputSupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5Gui.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5DeviceDiscoverySupport.a /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5Network.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5DBus.so /home/analog/qt-everywhere-src-5.13.0/qtbase/lib/libQt5Core.so /usr/lib/arm-linux-gnueabihf/libGL.so -lpthread
    mv -f libqvnc.so ../../../../plugins/platforms/libqvnc.so
    make[5]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src/plugins/platforms/vnc'
    make[4]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src/plugins/platforms'
    make[3]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src/plugins'
    make[2]: *** [sub-plugins-make_first] Error 2
    make[2]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase/src'
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory `/home/analog/qt-everywhere-src-5.13.0/qtbase'
    make: *** [module-qtbase-make_first] Error 2
    
    

  • Lifetime Qt Champion

    This doesn't show where the build failed.

    Re-run the build without the -j parameter so you'll see exactly were the error is.



  • In file included from qcomposeplatforminputcontextmain.cpp:44:0:
    qcomposeplatforminputcontext.h:46:41: fatal error: xkbcommon/xkbcommon-compose.h: No such file or directory
     #include <xkbcommon/xkbcommon-compose.h>
    

  • Qt Champions 2018

    @BrMisha said in How to build Qt on system without a GUI?:

    I installed this libs

    dev package also (which contains header files)?



  • @jsulm yes, libxkbcommon0 libxkbcommon-x11-dev libxkbcommon-dev are installed


  • Lifetime Qt Champion

    Did you re-run configure from a clean state ?



  • @SGaist I did re-unzip sources, then did configure))


  • Lifetime Qt Champion

    Can you check the configure log to see if there's anything related to that ?



  • Log i will saw after do configure?


  • Lifetime Qt Champion

    They are generated when configure is run. Look into your build folder.


Log in to reply