gpt4 book ai didi

qt - 错误 : QOpenGLShader: could not create shader - when compiling QtQuick applications with Qt5. 2 Mingw OpenGL

转载 作者:行者123 更新时间:2023-12-04 13:35:02 26 4
gpt4 key购买 nike

我已经下载并安装了“Qt 5.2 mingw(opengl 和 x86)”版本。当我用这个版本的 Qt 运行 Qt 项目时,没有问题。但是当我运行 Qt Quick 应用程序时,程序崩溃并且以下消息登录调试:

getProcAddress: Unable to resolve 'glGenRenderbuffers'
getProcAddress: Unable to resolve 'glGenRenderbuffersOES'
getProcAddress: Unable to resolve 'glGenRenderbuffersARB'
getProcAddress: Unable to resolve 'glGenRenderbuffersEXT'
getProcAddress: Unable to resolve 'glBindRenderbuffer'
getProcAddress: Unable to resolve 'glBindRenderbufferOES'
getProcAddress: Unable to resolve 'glBindRenderbufferARB'
getProcAddress: Unable to resolve 'glBindRenderbufferEXT'
getProcAddress: Unable to resolve 'glRenderbufferStorage'
getProcAddress: Unable to resolve 'glRenderbufferStorageOES'
getProcAddress: Unable to resolve 'glRenderbufferStorageARB'
getProcAddress: Unable to resolve 'glRenderbufferStorageEXT'
getProcAddress: Unable to resolve 'glGenRenderbuffers'
getProcAddress: Unable to resolve 'glGenRenderbuffersOES'
getProcAddress: Unable to resolve 'glGenRenderbuffersARB'
getProcAddress: Unable to resolve 'glGenRenderbuffersEXT'
getProcAddress: Unable to resolve 'glBindRenderbuffer'
getProcAddress: Unable to resolve 'glBindRenderbufferOES'
getProcAddress: Unable to resolve 'glBindRenderbufferARB'
getProcAddress: Unable to resolve 'glBindRenderbufferEXT'
getProcAddress: Unable to resolve 'glRenderbufferStorage'
getProcAddress: Unable to resolve 'glRenderbufferStorageOES'
getProcAddress: Unable to resolve 'glRenderbufferStorageARB'
getProcAddress: Unable to resolve 'glRenderbufferStorageEXT'
getProcAddress: Unable to resolve 'glFramebufferRenderbuffer'
getProcAddress: Unable to resolve 'glFramebufferRenderbufferOES'
getProcAddress: Unable to resolve 'glFramebufferRenderbufferARB'
getProcAddress: Unable to resolve 'glFramebufferRenderbufferEXT'
getProcAddress: Unable to resolve 'glFramebufferRenderbuffer'
getProcAddress: Unable to resolve 'glFramebufferRenderbufferOES'
getProcAddress: Unable to resolve 'glFramebufferRenderbufferARB'
getProcAddress: Unable to resolve 'glFramebufferRenderbufferEXT'
getProcAddress: Unable to resolve 'glGenBuffers'
getProcAddress: Unable to resolve 'glGenBuffersOES'
getProcAddress: Unable to resolve 'glGenBuffersARB'
getProcAddress: Unable to resolve 'glGenBuffersEXT'
getProcAddress: Unable to resolve 'glBindBuffer'
getProcAddress: Unable to resolve 'glBindBufferOES'
getProcAddress: Unable to resolve 'glBindBufferARB'
getProcAddress: Unable to resolve 'glBindBufferEXT'
getProcAddress: Unable to resolve 'glBufferData'
getProcAddress: Unable to resolve 'glBufferDataOES'
getProcAddress: Unable to resolve 'glBufferDataARB'
getProcAddress: Unable to resolve 'glBufferDataEXT'
getProcAddress: Unable to resolve 'glBindBuffer'
getProcAddress: Unable to resolve 'glBindBufferOES'
getProcAddress: Unable to resolve 'glBindBufferARB'
getProcAddress: Unable to resolve 'glBindBufferEXT'
getProcAddress: Unable to resolve 'glBindBuffer'
getProcAddress: Unable to resolve 'glBindBufferOES'
getProcAddress: Unable to resolve 'glBindBufferARB'
getProcAddress: Unable to resolve 'glBindBufferEXT'
getProcAddress: Unable to resolve 'glCreateProgram'
getProcAddress: Unable to resolve 'glCreateProgramARB'
getProcAddress: Unable to resolve 'glCreateProgramObject'
getProcAddress: Unable to resolve 'glCreateProgramObjectARB'
QOpenGLShaderProgram: could not create shader program
getProcAddress: Unable to resolve 'glCreateShader'
getProcAddress: Unable to resolve 'glCreateShaderARB'
getProcAddress: Unable to resolve 'glCreateShaderObject'
getProcAddress: Unable to resolve 'glCreateShaderObjectARB'
QOpenGLShader: could not create shader
Renderer failed shader compilation:
""

我该如何解决这个问题?这个问题和我的显卡有关吗?

最佳答案

当您的显卡驱动程序不支持 Qt.Quick 应用程序所必需的 OpenGL 2.0 时,就会发生这种情况。

第一个解决方案是升级您的显卡驱动程序。您也可以使用 OpenGL extensions Viewer验证您支持哪些 OpenGL 版本。

另一方面,如果您希望能够将您的应用程序部署到其他 Windows 安装并且不想要求用户更新他们的驱动程序,那么您不应该使用基于 OpenGL 的 Qt5 构建,而是基于 ANGLE 的构建。遗憾的是,从 Qt 5.1 开始,Qt 团队停止发布带有 ANGLE 和 mingw 的 Qt 版本。所以你要么需要自己重新编译 Qt,要么使用基于另一个编译器的版本。

有关 Qt5 和 Windows 以及 ANGLE/OpenGL 的更多信息,请访问 here

编辑 Qt5.3

Qt 5.3新信号已添加到 QQuickWindowsceneGraphError这使您可以知道初始化失败,而不仅仅是获得一个空白屏幕。

此外,Qt 团队正在致力于首先在客户端计算机上尝试 OpenGL,如果失败则回退到 ANGLE。这在 Qt 5.3 中仍处于实验阶段并且应该是 Qt 5.4 的一部分释放。

关于qt - 错误 : QOpenGLShader: could not create shader - when compiling QtQuick applications with Qt5. 2 Mingw OpenGL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20530157/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com