Deploying Qt3D application using MinGW 32. Unable to find renderer plugin for opengl
-
wrote on 27 Jun 2020, 19:10 last edited by 8Observer8
When I run my simple example in debug mode from Qt Creator I see these messages:
QString::arg: Argument missing: " Max Work Group Size: 1536, 1024, 64\n Max Work Group Count: 65535, 65535, 65535\n Max Invocations: 65535\n Max Shared Memory Size: 1536\n" , 49152 QObject::connect(QOpenGLContext, Unknown): invalid nullptr parameter
My program works fine:And when I switch to Release mode I see the same behavior like above. But I what to make a standalone application for running on another computers without Qt.
I added this dll-files to Release folder:
platforms/qwindows.dll libgcc_s_dw2-1.dll libstdc++-6.dll libwinpthread-1.dll Qt5Concurrent.dll Qt5Core.dll Qt5Gamepad.dll Qt5Gui.dll Qt5Network.dll Qt53DCore.dll Qt53DExtras.dll Qt53DInput.dll Qt53DLogic.dll Qt53DRender.dll
But when I try to run Release version from Qt Creator I get this message in console:
Unable to find renderer plugin for opengl 23:00:29: The program has unexpectedly finished.
And I get this exception:
Fail Fast Exception. A fail fast exception occurred. Exception handlers will not be invoked and the process will be terminated immediately.
My source code:
Bullet3Qt3D.pro
QT += 3dcore 3drender 3dlogic 3dextras INCLUDEPATH += "E:\Libs\Bullet3-2.89\include" LIBS += -L"E:\Libs\Bullet3-2.89\lib" LIBS += -lBulletDynamics -lBulletCollision -lLinearMath SOURCES += \ main.cpp RESOURCES += \ Models.qrc
main.cpp
#ifdef _WIN32 #include <windows.h> extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001; #endif #include <QGuiApplication> #include <QEntity> #include <Qt3DWindow> #include <btBulletDynamicsCommon.h> #include <QCamera> #include <QPointLight> #include <QTransform> #include <QSceneLoader> #include <QOrbitCameraController> #include <QPhongMaterial> int main(int argc, char *argv[]) { QGuiApplication::setAttribute(Qt::AA_UseDesktopOpenGL); QGuiApplication app(argc, argv); Qt3DExtras::Qt3DWindow view; view.setGeometry(500, 100, 270, 270); Qt3DRender::QCamera *camera = view.camera(); camera->lens()->setPerspectiveProjection(60.0f, view.width()/(float)view.height(), 0.1f, 1000.0f); camera->setPosition(QVector3D(0.0f, 0.0f, 30.0f)); camera->setViewCenter(QVector3D(0.0f, 0.0f, 0.0f)); Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity; Qt3DCore::QEntity *lightEntity = new Qt3DCore::QEntity(rootEntity); Qt3DRender::QPointLight *pointLight = new Qt3DRender::QPointLight(lightEntity); Qt3DCore::QTransform *lightTransform = new Qt3DCore::QTransform(rootEntity); lightTransform->setTranslation(QVector3D(10.0f, 20.0f, 30.0f)); lightEntity->addComponent(pointLight); lightEntity->addComponent(lightTransform); Qt3DCore::QEntity *cubeEntity = new Qt3DCore::QEntity(rootEntity); Qt3DRender::QSceneLoader *sceneLoader = new Qt3DRender::QSceneLoader(cubeEntity); sceneLoader->setSource(QUrl("qrc:/Models/Cube.obj")); cubeEntity->addComponent(sceneLoader); Qt3DCore::QTransform *cubeTransform = new Qt3DCore::QTransform(cubeEntity); cubeTransform->setScale(7.0f); cubeEntity->addComponent(cubeTransform); QStringList list = sceneLoader->entityNames(); Qt3DExtras::QPhongMaterial *material = new Qt3DExtras::QPhongMaterial(rootEntity); rootEntity->addComponent(material); Qt3DExtras::QOrbitCameraController *cameraController = new Qt3DExtras::QOrbitCameraController(rootEntity); cameraController->setCamera(camera); cameraController->setLookSpeed(180.0f); cameraController->setLinearSpeed(50.0f); view.setRootEntity(rootEntity); view.show(); return app.exec(); }
-
wrote on 27 Jun 2020, 22:45 last edited by
I solved this problem. I copied the folder "renderers/openglrenderer.dll" to the release folder from "C:\Qt\5.15.0\mingw81_32\plugins"
-
wrote on 28 Jun 2020, 08:30 last edited by
-
wrote on 4 Jul 2020, 13:21 last edited by
Exactly what I needed...tx!
-
wrote on 8 Sept 2020, 07:58 last edited by
Hi @8Observer8,
thanks for providing the answer to your own question!
In your case, does the solution also remove the "Argument missing" and "invalid nullptr parameter" messages?
In my case it did not and I am wondering wether they are potentially problematic or not.
Cheers -
wrote on 24 Feb 2021, 10:04 last edited by
Hi, thanks for the answer to this problem.
I ran into it while trying to use QT3D for Qt6, even after copying the plugins folder.
I found the solution so i post it here for anyone having this problem with Qt6 :Qt6OpenGL.dll should also be copied next to the executable for it to work.
-
wrote on 25 Feb 2021, 12:30 last edited by 8Observer8
I built Qt to static release and compressed EXE using UPX. My EXE has only 7 MBytes. But I use pure OpenGL without Qt3D.