Has anyone ever gotten cross-compiling with Qt5.x to actually work?

I’ve seen a blog with ambiguous instructions, but absolutely no luck in actually getting it to work. So I’m desperate to find someone how can personally vouch that they did get it to work and will tell us how they got it to work.

Hi drhalftone,

Maybe you could refer to bloew thread to see if any helps:
[url]https://devtalk.nvidia.com/default/topic/952977/jetson-tx1/jetson-tx1-qt5-and-qt-gstreammer-installation/post/4959709/#4959709[/url]

I’m afraid it doesn’t. That post refers to installing and running Qt developer tools onto the Jetson TX1 board itself. I want to set up cross compiling. Laszlo Agocs has a blog where he claims to have gotten it to work, but the directions are ambiguous at best, and I haven’t had any success replicating his supposed results.

Hi drhalftone

You may need to ask the suggestion from Laszlo Agocs if he could share more information to resolve your case.

Thanks.

the qt5 need the compile support c++11

The newer Linaro cross compilers support c++11. I think the older 4.8 crosstool ng does not.

I’d certainly love to contact Laszlo Agocs directly, but that particular article is closed to comments. And I haven’t had any luck at contacting Laszlo Agocs directly. I even tried connecting through a friend on linked in. Do you have any suggestions how to reach him?

I have cross compiled the 5.7.1

this is the way of how to compile it
1.
you have to flash the L4T 24.2.1 to board, as the cross compile, support the c++11, c++14 and c++1z

  1. down load the Qt5.7.1 source code to the board ,or to you local computer but you have to mount it to develop board. Building Qt 5 from Git - Qt Wiki

  2. install the opengles2.0
    sudo apt-get install opengles2-mesa-dev
    why ? as the qtquick module need it, by look at the qtdeclarative/src/src.pro ,we know the es2 is required

    qtHaveModule(gui):contains(QT_CONFIG, opengl(es1|es2)?) {
    SUBDIRS +=
    quick
    qmltest
    particles

     qtHaveModule(widgets): SUBDIRS += quickwidgets
    

    }

  3. sudo apt-get install “^libxcb.*” libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev

  4. sudo apt-get install libinput*

  5. sudo apt-get install mtdev* // multi-touch-protocol

  6. the checking stage dlopen will print no,
    qtbase/config.tests/unix/dlopen contain the dlopen.cpp.
    the check step will compile the dlopen and link it, but the ld can’t find the libdl.so
    we should use the -L and -l to tel the ld how to link it, by this way, the check of dlopen
    will be “yes”

  7. create the tar ball of the download qt5.7.1 source code, if the compile is failed, remove it, then compile it again. if you compile it by the TX1 board, the configure step, will know the arch of the process is aarch64. and will check the necessary head and lib, so, I recommend compile it by the board directly.

  8. this the configure shell

#! /bin/bash
pushd ./qt5; # /qt5 is my source file dir

./configure -opensource
-release
–confirm-license
-linuxfb
-no-tslib
-no-sql-sqlite
-qt-libpng \ #use the self lib, I think will decrease the wrong
-qt-libjpeg \ #as the Qt like to use the newest .h, the system lib
-qt-freetype \ #might too old to meet the require.
-qt-xkbcommon-x11
-L /usr/lib/aarch64-linux-gnu \ #make the check of dlopen success
-l dl
-skip multimedia
-skip wayland
-skip winextras
-skip webchannel \ #my work, the web is useless
-skip webengine
-skip websockets
-skip webkit
-skip webview
-skip webkit-examples
-nomake examples \
-nomake tests
-nomake tools;

popd;

  1. make -j4, -j4 is required ,the compile will spend one or two hour, you can use the max clock shell written by NVidia put the tx1 run at the max speed.

  2. sudo make install.

@Chenghaibo

Could you please give us some additional details on where you are entering your various commands?
On the device or the host?
Could you also precise whether some repositories should be declared first (to get the relevant packages when sudo-apt installing)?

Regards.

This post here explains how to configure cross compiling with Qt on Ubuntu and has some scripts to automate the process for setting up the environment, [url]https://devtalk.nvidia.com/default/topic/1015414/jetson-tx2/cross-compiling-with-qt/[/url].

Thanks … but are you sure your method works with TX1 (which cannot use a 4.x kernel contrary to the TX2)?
I found the 3.x kernel to be a problem for ARM64 architecture and Qt.