Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOpenGLShader: could not create shader
Forum Updated to NodeBB v4.3 + New Features

QOpenGLShader: could not create shader

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 215 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    samdol
    wrote on last edited by samdol
    #1

    Hi,

    I created MyGLWidget like:
    class MyGLWidget: public QOpenGLWidget, protected QOpenGLFunctions
    {
    Q_OBJECT
    public:
    MyGLWidget: ();
    protected:
    void initializeGL() Q_DECL_OVERRIDE;
    }
    void MyGLWidget::initializeGL()
    {
    initializeOpenGLFunctions();

    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
    
    glEnable(GL_TEXTURE_2D);
    glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
    glDepthFunc(GL_LEQUAL);
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
    m_v = new QOpenGLShader(QOpenGLShader::Vertex);
    m_f = new QOpenGLShader(QOpenGLShader::Fragment);
    

    }

    When I ran this code on Qt from qt-opensource-windows-x86-mingw492-5.6.2.exe, it run without any issue.
    But when I run it on Qt built by myself statically, it gives me an error message:
    """
    QOpenGLShader: could not create shader
    QOpenGLShader: could not create shader
    """
    I am not sure what cause this runtime error.

    When I built static-Qt, I used the following configuration and mingw64.
    configure -prefix C:\Qt\5.6.2 -static -release -platform win32-g++ -nomake examples -nomake tests -opengl desktop
    Do I have to configure differently to fix this problem?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved