8Observer8
27th June 2020, 20:28
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:
13489
Fail Fast Exception. A fail fast exception occurred. Exception handlers will not be invoked and the process will be terminated immediately.
My source code:
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_UseDesktopOpe nGL);
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();
}
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:
13489
Fail Fast Exception. A fail fast exception occurred. Exception handlers will not be invoked and the process will be terminated immediately.
My source code:
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_UseDesktopOpe nGL);
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();
}