Unsolved Recommended way to deploy/install Qt6 shared libraries
-
@Mark81 said in Recommended way to deploy/install Qt6 shared libraries:
this would just copy the required files, right?
Yes.
The thing with Linux is that there are many different distributions, in different versions with different package managers. So, there is no "one fits all" solution for Linux. For example: for Debian based Distributions you would create a Debian (deb) package where you also define the dependencies and where to install what. For RedHat/Fedora based distributions you would create a RPM package.
Since you want to support Ubuntu 20.04 you should take a look at how to create Debian packages. -
@jsulm I understand that, but why there is no way to invoke the Qt Installer from command line? I works perfectly on a Desktop environment... so it can also download and build the selected modules in a server environment.
Building from sources requires several GB of spaces, tons of packages, lot of hours and headaches for something that the installer does every time with no pain...
-
@Mark81 Why do you need to build anything on the target machine?
Why not build your app on the developer machine, create installer or Debian package and distribute it then? -
@jsulm Because as I said the target machine does not run the X server. So when developing I need to debug the remote application while it runs with eglfs. Furthermore in this project the screen is vertical, so it would be very tricky to develop locally...
Another example: for another project (always with Ubuntu Server 20.04) the target machine is connected to the field (Modbus, OPC-UA and Ethernet). I can't really debug the console application locally, I have to run and debug it on the target otherwise I cannot receive the data from the field.
-
@Mark81 You don't have to build on target machine to do remote debugging. Build on your developer machine, copy the binary to the target machine and debug remotely.
-
@jsulm the problem is it does not deploy the libraries! And without the libraries of course it cannot run.
I meant build the Qt6 libraries, not my application. -
@Mark81 Simply deploy the libraries once from host to the target...
-
@jsulm I wrote this suggestion in my own question :-)
But it does work for console application only.I guess it is because the libraries on the dev machines are built (from the online installed) against x11, while the target machine requires eglfs. I tried to explore the online installer items but I didn't find anything that allows me to select eglfs. I guess it detects the platform automatically when it runs. From here the request to run it without X.
-
@Mark81 said in Recommended way to deploy/install Qt6 shared libraries:
But it does work for console application only.
It should work if you also deploy eglfs platform plug-in.
-
@jsulm so far I tried to build a simple QtWidget "Hello world" application on my dev machine.
Then I copied it to the target with this structure:$ tree
.
├── test_qt6
│ └── bin
│ ├── test_qt6
│ └── platforms
│ └── libqeglfs.so
├── qt6_libs
│ ├── libicudata.so
│ ├── libicudata.so.56
│ ├──libicudata.so.56.1
│ ├──libicui18n.so
│ ├──libicui18n.so.56
│ ├──libicui18n.so.56.1
│ ├──but running the application with:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/qt6_libs /home/user/test_qt6/bin/./test_qt6 -platform eglfs
it still searches for x11:
./test_qt6: error while loading shared libraries: libxkbcommon.so.0: cannot open shared object file: No such file or directory
ps. sorry but the editor loses the indentation. The platform plugin file is actually inside the
platforms
directoryUPDATE
I tried to copy the missing library, now
ldd
finds all.
But still does not run:EGLFS: Failed to open /dev/fb0
EGLFS: Can't continue without a displayI'm working to check the permissions.... fixed.
$ export QT_QPA_PLATFORM=eglfs $ export QT_QPA_EGLFS_FB=/dev/fb0 $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/qt6_libs ./test_qt6 -platform eglfs Could not initialize egl display Aborted (core dumped)