Eu estou tendo problemas para realizar o deploy do programa feito em QT com C++ no Linux.
Uso esse script em bash para copiar as bibliotecas SO pro programa:
#/bin/bash
sudo cp -r /opt/Qt/6.2.2/gcc_64/lib/* "$PWD"
sudo cp -r /opt/Qt/6.2.2/gcc_64/plugins/* "$PWD"
sudo cp -r /opt/Qt/Tools/QtCreator/lib/Qt/lib/* "$PWD"
sudo chown -R eu:eu *
No entanto, depois do deploy, quando tento executar o programa, ele dá o seguinte erro:
QFactoryLoader::QFactoryLoader() checking directory path “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms” …
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqeglfs.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqeglfs.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“eglfs”
]
},
“archreq”: 0,
“className”: “QEglFSIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“eglfs”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqlinuxfb.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqlinuxfb.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“linuxfb”
]
},
“archreq”: 0,
“className”: “QLinuxFbIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“linuxfb”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqminimal.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqminimal.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“minimal”
]
},
“archreq”: 0,
“className”: “QMinimalIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“minimal”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqminimalegl.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqminimalegl.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“minimalegl”
]
},
“archreq”: 0,
“className”: “QMinimalEglIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“minimalegl”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqoffscreen.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqoffscreen.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“offscreen”
]
},
“archreq”: 0,
“className”: “QOffscreenIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“offscreen”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqvkkhrdisplay.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqvkkhrdisplay.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“vkkhrdisplay”
]
},
“archreq”: 0,
“className”: “QVkKhrDisplayIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“vkkhrdisplay”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqvnc.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqvnc.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“vnc”
]
},
“archreq”: 0,
“className”: “QVncIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“vnc”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqwayland-egl.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqwayland-egl.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“wayland-egl”
]
},
“archreq”: 0,
“className”: “QWaylandEglPlatformIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“wayland-egl”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqwayland-generic.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqwayland-generic.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“wayland”
]
},
“archreq”: 0,
“className”: “QWaylandIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“wayland”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqwayland-xcomposite-egl.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqwayland-xcomposite-egl.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“wayland-xcomposite-egl”
]
},
“archreq”: 0,
“className”: “QWaylandXCompositeEglPlatformIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“wayland-xcomposite-egl”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqwayland-xcomposite-glx.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqwayland-xcomposite-glx.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“wayland-xcomposite-glx”
]
},
“archreq”: 0,
“className”: “QWaylandXCompositeGlxPlatformIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“wayland-xcomposite-glx”)
QFactoryLoader::QFactoryLoader() looking at “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqxcb.so”
Found metadata in lib /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqxcb.so, metadata=
{
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,
“MetaData”: {
“Keys”: [
“xcb”
]
},
“archreq”: 0,
“className”: “QXcbIntegrationPlugin”,
“debug”: false,
“version”: 393728
}Got keys from plugin meta data QList(“xcb”)
Cannot load library /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqxcb.so: (libQt6XcbQpa.so.6: não é possível abrir arquivo compartilhado: Arquivo ou diretório inexistente)
QLibraryPrivate::loadPlugin failed on “/home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqxcb.so” : “Cannot load library /home/eu/Projetos/QT com C++/build-Teste-Desktop_Qt_6_2_2_GCC_64bit-Release/platforms/libqxcb.so: (libQt6XcbQpa.so.6: não é possível abrir arquivo compartilhado: Arquivo ou diretório inexistente)”
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Abortado (imagem do núcleo gravada)
Eu procurei as bibliotecas SO dentro da pasta do programa e todas estão lá, mas mesmo assim não roda. Dentro do QT ele funciona normalmente, o problema é rodar fora do QT depois de fazer o deploy.