Cannot deploy to Linux system whatsoever
-
I have tried making a distributable application with no avail on Linux, can someone please assist me?
I read the deployment for Linux/X11 all week and looked through the internet for solutions.
I first tried with qt.conf:- I have put it inside the executable file
- I have put it inside qrc:/qt/etc/qt.conf
Both not working at all, the first mentioned it was like it wasn't even present, and the second it wouldn't find the path(from what I have seen)
I have tried then using rpath:
- when I put this path, the executable file could find the libraries but libqxcb.so couldn't
I finally resorted to using LD_LIBRARY_PATH:
- I set the path to libraries but then the executable crashes with: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
-
I have tried making a distributable application with no avail on Linux, can someone please assist me?
I read the deployment for Linux/X11 all week and looked through the internet for solutions.
I first tried with qt.conf:- I have put it inside the executable file
- I have put it inside qrc:/qt/etc/qt.conf
Both not working at all, the first mentioned it was like it wasn't even present, and the second it wouldn't find the path(from what I have seen)
I have tried then using rpath:
- when I put this path, the executable file could find the libraries but libqxcb.so couldn't
I finally resorted to using LD_LIBRARY_PATH:
- I set the path to libraries but then the executable crashes with: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
@adutzu89 said in Cannot deploy to Linux system whatsoever:
Both not working at all, the first mentioned it was like it wasn't even present, and the second it wouldn't find the path(from what I have seen)
qt.conf goes in the directory where the application is located, it doesn't go into qrc, or into the binary.
when I put this path, the executable file could find the libraries but libqxcb.so couldn't
If you haven't modified the rpath for the said shared object, then it's small wonder it won't find the libraries.
I set the path to libraries but then the executable crashes with: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
That sounds like
libqxcb.so
can't findlibxcb.so
or the OGL libraries. Try tracing the dependencies, e.g:LD_LIBRARY_PATH=/path/you/set/when/running/app:$LD_LIBRARY_PATH ldd /path/to/libqxcb.so
Then check if the link paths are pointing to valid libraries.
Kind regards.
-
Thank you for taking your time to help.
qt.conf goes in the directory where the application is located, it doesn't go into qrc, or into the binary.
According to the documentation in "using qt.conf":
QLibraryInfo will load qt.conf from one of the following locations:
:/qt/etc/qt.conf using the resource systemand in Qt resource system:
The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable.
My understanding is that any files add in the resource system end up in final binary file(executable file), correct me if I am wrong?
If you haven't modified the rpath for the said shared object, then it's small wonder it won't find the libraries.
I want to avoid such thing if I don't need it so I haven't changed rpath of anything but my application and now it's removed even from application .pro file.
Then check if the link paths are pointing to valid libraries.
I have run ldd on several libraries(and ofc my binary) including libqxcb.so and all dependencies are met.
-
Thank you for taking your time to help.
qt.conf goes in the directory where the application is located, it doesn't go into qrc, or into the binary.
According to the documentation in "using qt.conf":
QLibraryInfo will load qt.conf from one of the following locations:
:/qt/etc/qt.conf using the resource systemand in Qt resource system:
The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable.
My understanding is that any files add in the resource system end up in final binary file(executable file), correct me if I am wrong?
If you haven't modified the rpath for the said shared object, then it's small wonder it won't find the libraries.
I want to avoid such thing if I don't need it so I haven't changed rpath of anything but my application and now it's removed even from application .pro file.
Then check if the link paths are pointing to valid libraries.
I have run ldd on several libraries(and ofc my binary) including libqxcb.so and all dependencies are met.
@adutzu89 said in Cannot deploy to Linux system whatsoever:
According to the documentation in "using qt.conf":
QLibraryInfo will load qt.conf from one of the following locations:
:/qt/etc/qt.conf using the resource systemYes, apparently it does, my bad, sorry.
My understanding is that any files add in the resource system end up in final binary file(executable file), correct me if I am wrong?
No, not always, but usually (by default) it ends up in the binary.
I want to avoid such thing if I don't need it so I haven't changed rpath of anything but my application and now it's removed even from application .pro file.
I have run ldd on several libraries(and ofc my binary) including libqxcb.so and all dependencies are met.I still think the
qt.conf
file is your best bet then. Usually it's a trivial (but not trivial to find) problem with the paths. Can you provide you project structure and theqt.conf
file you had used? -
Hi,
You can also take a look at the linuxdeployqt which aims to assist in Linux application deployment.
-
Hi,
You can also take a look at the linuxdeployqt which aims to assist in Linux application deployment.
-
@adutzu89 said in Cannot deploy to Linux system whatsoever:
According to the documentation in "using qt.conf":
QLibraryInfo will load qt.conf from one of the following locations:
:/qt/etc/qt.conf using the resource systemYes, apparently it does, my bad, sorry.
My understanding is that any files add in the resource system end up in final binary file(executable file), correct me if I am wrong?
No, not always, but usually (by default) it ends up in the binary.
I want to avoid such thing if I don't need it so I haven't changed rpath of anything but my application and now it's removed even from application .pro file.
I have run ldd on several libraries(and ofc my binary) including libqxcb.so and all dependencies are met.I still think the
qt.conf
file is your best bet then. Usually it's a trivial (but not trivial to find) problem with the paths. Can you provide you project structure and theqt.conf
file you had used?@kshegunov said in Cannot deploy to Linux system whatsoever:
I still think the
qt.conf
file is your best bet then. Usually it's a trivial (but not trivial to find) problem with the paths. Can you provide you project structure and theqt.conf
file you had used?Ok so here is my directory structure:
lib
plugins- plugins/bearer
plugins/libexec
plugins/platforms
plugins/resources
qml
- qml/QtQuick
qml/QtQuick.2
qml/QtWebView
<binary-file>
qt.confContent of qt.conf:
[Paths]
Libraries = lib
Plugins = plugins
Qml2Imports = qml - plugins/bearer
-
The issue was solved after putting the xcbglintegrations plugin, don't know I remember previously trying that and didn't worked, ah well now it it goes past that
Now I get other issues:
Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
QQmlComponent: Component is not ready
QObject::connect: invalid null parameter
QObject::connect: invalid null parameter
QObject::connect: invalid null parameter
QObject::connect: invalid null parameterAnd besides that the binary still doesn't takes qt.conf paths to search.
-
The issue was solved after putting the xcbglintegrations plugin, don't know I remember previously trying that and didn't worked, ah well now it it goes past that
Now I get other issues:
Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
QQmlComponent: Component is not ready
QObject::connect: invalid null parameter
QObject::connect: invalid null parameter
QObject::connect: invalid null parameter
QObject::connect: invalid null parameterAnd besides that the binary still doesn't takes qt.conf paths to search.
Perhaps you can check from the application (after you create the application object) a few of the paths, this might hint if your
qt.conf
's been loaded. E.g.:qDebug() << QLibraryInfo::location(QLibraryInfo::PluginsPath); // Should give you the plugin loading path
PS. If it's able to load the xcb integration, then I'd assume the paths are working okay. It might be a plugin dependency problem ...
-
Apparently the issue is my machine on which I target, a Xubuntu 16.04, but on my main laptop which is powered by an Uubuntu 16.04 qt.conf seems to work.
Even tough previously it didn't, when I was searching for qt.conf with: qDebug() << "qt.conf " << QDir(QCoreApplication::applicationDirPath()).exists("qt.conf"); it returned false but the file was in the same directory as the binary file.(it might have been because of different options changes to my .pro file(who knows, I don't remember what modifications I had to it then).
After seeing that qt.conf forces my application to search for deployment files in my specified locations I decided to deploy it again on my Xubuntu virtual machine, but it didn't used the qt.conf file until I have exported LD_LIBRARY_PATH.....I'm assuming this behaviour isn't normal and should be related to the OS.The last error I mentioned, "Qt: Session management error:....", seems to be because I haven't deployed QtWebEngine qml module ( I was deploying only QtWebView ).
I will try this evening after work -rpath and qt.conf to see if it starts without issues.