简体   繁体   English

Qt和GLEW:程序退出,代码为-1073741515

[英]Qt and GLEW: The program exited with code -1073741515

I an working with Qt and I am trying to switch from OpenGL 1.0 to a newer OpenGL by using GLEW. 我在Qt上工作,并且尝试使用GLEW从OpenGL 1.0切换到较新的OpenGL。 I have a GUi which uses a subclass of QGLWidget to process OpenGL stuff. 我有一个使用QGLWidget的子类来处理OpenGL东西的GUi。 At the beginning of initializeGL I do the statement GLenum err = glewInit(); initializeGL的开头,我执行语句GLenum err = glewInit(); and this causes the following: 这会导致以下情况:

program.exe exited with code -1073741515

Some more details: libs: 更多详细信息:libs:

LIBS += -L"C:/Program Files/Microsoft SDKs/Kinect/v1.7/lib/amd64/" -lKinect10
LIBS += -lOpenGL32
LIBS += -lglew32
LIBS += -lglu32

Headers: 标头:

#include <windows.h>
#include <gl/glew.h>
#include <QByteArray>
#include <QGLWidget>
#include <memory>
#include <algorithm>

Full initializeGL() function: 完整的initializeGL()函数:

void OpenGLWidget::initializeGL(){
    GLenum err = glewInit();
    if (GLEW_OK != err)
    {
      /* Problem: glewInit failed, something is seriously wrong. */

    }
    glEnable(GL_TEXTURE_2D); //Enables the drawing of 2D textures
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width(), height(), 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, (GLvoid*) NULL);
    glBindTexture(GL_TEXTURE_2D, textureId); //Binds the GL_TEXTURE_2D to the textureId
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width(), height(), 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, (GLvoid*) blackScreen); //Strart the program off with a black screen
    glBindTexture(GL_TEXTURE_2D, textureId); //Binds the GL_TEXTURE_2D to the textureId
    glClearColor(0,0,0,0);
    glClearDepth(1.0f);
}

What am I doing wrong? 我究竟做错了什么?

  • Does your version of Qt come with OpenGL support? 您的Qt版本是否支持OpenGL? Believe it or not, some don't. 信不信由你,有些则不然。 This was the case for me and it drove me crazy. 对我来说就是这种情况,这让我发疯。 Download a version of Qt with OpenGL support and replace the one you have. 下载具有OpenGL支持的Qt版本,并替换您拥有的版本。 If all goes well you shouldn't have a problem. 如果一切顺利,您应该不会有问题。
  • If you don't want to download a prebaked version, you must build Qt from scratch. 如果您不想下载预先烘焙的版本,则必须从头开始构建Qt。 This requires Python, Perl, possibly Ruby, and more than a little patience (because it's never as easy as the tutorials make you think). 这需要Python,Perl,可能还有Ruby,并且还需要更多的耐心(因为它从未像教程中想象的那么容易)。
  • The error code you're getting seems to be a linking error that seems to have been solved here . 您收到的错误代码似乎是一个链接错误 ,似乎已经在这里解决 Hopefully that solves it. 希望能解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OpenCV 2.4.10 + Qt Creator 3.2.0和Qt5.4.0 MingW 64bits Windows 7 - “退出代码-1073741515” - OpenCV 2.4.10 + Qt Creator 3.2.0 & Qt5.4.0 MingW 64bits Windows 7 - “exited with code -1073741515” 调用 GLEW 函数时,进程以退出代码 -1073741515 结束 - Process finished with exit code -1073741515 when calling GLEW functions Qt OpenCV程序退出,代码为-1073741515 - Qt OpenCV programm exits with code -1073741515 错误MSB6006:“ midl.exe”退出,代码为-1073741515 - error MSB6006: “midl.exe” exited with code -1073741515 OpenGL 应用程序退出,退出代码为 -1073741515 (0xC0000135) - OpenGL application exited with exit code -1073741515 (0xC0000135) code exited -1073741515 (0xc0000135) 'A dependent dll was not found' - code exited -1073741515 (0xc0000135) 'A dependent dll was not found' Visual Studio 2013:CL.exe退出,代码为-1073741515 - Visual Studio 2013: CL.exe exited with code -1073741515 sample.exe&#39;已退出,代码为-1073741515&#39;未找到相关的dll&#39; - sample.exe' has exited with code -1073741515 'A dependent dll was not found' Qt4程序意外完成(代码-1073741819退出) - Qt4 program unexpectedly finished (exited with code -1073741819) FFmpeg进入Qt 5.0.2:在av_register_all()上退出代码-1073741515; - FFmpeg into Qt 5.0.2: exit code -1073741515 on av_register_all();
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM