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. QOpenGLShaderProgram - shader program is not linked
Qt 6.11 is out! See what's new in the release blog

QOpenGLShaderProgram - shader program is not linked

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 5.0k Views 1 Watching
  • 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.
  • C Offline
    C Offline
    Chohan
    wrote on last edited by
    #1

    I want to use QML Type "Surface 3D" and I get shader program not linked error. As a test run, I tried using Qt example project: qmlsurface configured using "Desktop Qt 5.9.0 MinGW 32bit". The program does run but in the application output I am getting following message:

    QML debugging is enabled. Only use this in a safe environment.
    QOpenGLShader::link: Varying "coords_mdl" has different type width across different shaders.
    
    QOpenGLShaderProgram::attributeLocation(vertexPosition_mdl): shader program is not linked
    QOpenGLShaderProgram::attributeLocation(vertexNormal_mdl): shader program is not linked
    QOpenGLShaderProgram::attributeLocation(vertexUV): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(MVP): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(V): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(M): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(itM): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(depthMVP): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(lightPosition_wrld): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(lightStrength): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(ambientStrength): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(shadowQuality): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(color_mdl): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(textureSampler): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(shadowMap): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(gradMin): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(gradHeight): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(lightColor): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(volumeSliceIndices): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(colorIndex): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(cameraPositionRelativeToModel): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(color8Bit): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(textureDimensions): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(sampleCount): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(alphaMultiplier): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(preserveOpacity): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(minBounds): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(maxBounds): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(sliceFrameWidth): shader program is not linked
    QOpenGLShader::link: Varying "coords_mdl" has different type width across different shaders.
    
    QOpenGLShaderProgram::attributeLocation(vertexPosition_mdl): shader program is not linked
    QOpenGLShaderProgram::attributeLocation(vertexNormal_mdl): shader program is not linked
    QOpenGLShaderProgram::attributeLocation(vertexUV): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(MVP): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(V): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(M): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(itM): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(depthMVP): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(lightPosition_wrld): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(lightStrength): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(ambientStrength): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(shadowQuality): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(color_mdl): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(textureSampler): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(shadowMap): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(gradMin): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(gradHeight): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(lightColor): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(volumeSliceIndices): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(colorIndex): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(cameraPositionRelativeToModel): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(color8Bit): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(textureDimensions): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(sampleCount): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(alphaMultiplier): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(preserveOpacity): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(minBounds): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(maxBounds): shader program is not linked
    QOpenGLShaderProgram::uniformLocation(sliceFrameWidth): shader program is not linked
    

    I have AMD radeon graphic card. OpenGL® Version is 4.6 (found using OpenGL view program) and all graphic drivers are up to dated. Please guide me (preferably step by step as I am new to Qt)

    Thanks

    W 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Sorry I can't directly help you but you should provide more informations about the hardware you have as well as driver versions (what's up to date today might not be tomorrow).

      You might also want to test a more recent version of Qt. The latest is 5.15.0.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      C 1 Reply Last reply
      0
      • C Chohan

        I want to use QML Type "Surface 3D" and I get shader program not linked error. As a test run, I tried using Qt example project: qmlsurface configured using "Desktop Qt 5.9.0 MinGW 32bit". The program does run but in the application output I am getting following message:

        QML debugging is enabled. Only use this in a safe environment.
        QOpenGLShader::link: Varying "coords_mdl" has different type width across different shaders.
        
        QOpenGLShaderProgram::attributeLocation(vertexPosition_mdl): shader program is not linked
        QOpenGLShaderProgram::attributeLocation(vertexNormal_mdl): shader program is not linked
        QOpenGLShaderProgram::attributeLocation(vertexUV): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(MVP): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(V): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(M): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(itM): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(depthMVP): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(lightPosition_wrld): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(lightStrength): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(ambientStrength): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(shadowQuality): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(color_mdl): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(textureSampler): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(shadowMap): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(gradMin): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(gradHeight): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(lightColor): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(volumeSliceIndices): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(colorIndex): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(cameraPositionRelativeToModel): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(color8Bit): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(textureDimensions): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(sampleCount): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(alphaMultiplier): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(preserveOpacity): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(minBounds): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(maxBounds): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(sliceFrameWidth): shader program is not linked
        QOpenGLShader::link: Varying "coords_mdl" has different type width across different shaders.
        
        QOpenGLShaderProgram::attributeLocation(vertexPosition_mdl): shader program is not linked
        QOpenGLShaderProgram::attributeLocation(vertexNormal_mdl): shader program is not linked
        QOpenGLShaderProgram::attributeLocation(vertexUV): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(MVP): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(V): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(M): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(itM): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(depthMVP): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(lightPosition_wrld): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(lightStrength): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(ambientStrength): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(shadowQuality): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(color_mdl): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(textureSampler): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(shadowMap): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(gradMin): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(gradHeight): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(lightColor): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(volumeSliceIndices): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(colorIndex): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(cameraPositionRelativeToModel): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(color8Bit): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(textureDimensions): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(sampleCount): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(alphaMultiplier): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(preserveOpacity): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(minBounds): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(maxBounds): shader program is not linked
        QOpenGLShaderProgram::uniformLocation(sliceFrameWidth): shader program is not linked
        

        I have AMD radeon graphic card. OpenGL® Version is 4.6 (found using OpenGL view program) and all graphic drivers are up to dated. Please guide me (preferably step by step as I am new to Qt)

        Thanks

        W Offline
        W Offline
        wrosecrans
        wrote on last edited by
        #3

        @Chohan said in QOpenGLShaderProgram - shader program is not linked:

        QOpenGLShader::link: Varying "coords_mdl" has different type width across different shaders.

        A general rule of thumb when debugging is to start with the first error message. The first error can cause later errors. But later errors can't have caused the first one. The notes about the shader not being linked are a consequence of the linker error that mentions that varying, so that's probably what you want to start with.

        C 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Sorry I can't directly help you but you should provide more informations about the hardware you have as well as driver versions (what's up to date today might not be tomorrow).

          You might also want to test a more recent version of Qt. The latest is 5.15.0.

          C Offline
          C Offline
          Chohan
          wrote on last edited by
          #4

          @SGaist Thanks for the reply.
          Computer specs:
          OS - Windows 10 Pro 64-bit, Dell Inspiron 5770, i7-8550U CPU @ 1.8GHz (8 CPU), 16GB RAM, DirectX 12
          I have following display adapters:
          i. AMD Radeon R7 M460 - driver version: 26.20.12028.2 (latest according to update)
          ii. Intel(R) UHD Graphics 620 - driver version: 26.20.100.8142 (also latest)
          iii. Dell Universal Dock D6000 - driver version: 9.1.1644.0 (latest as well)

          of course, I tried without docking or extra monitor attached as well, still same problem.

          1 Reply Last reply
          0
          • W wrosecrans

            @Chohan said in QOpenGLShaderProgram - shader program is not linked:

            QOpenGLShader::link: Varying "coords_mdl" has different type width across different shaders.

            A general rule of thumb when debugging is to start with the first error message. The first error can cause later errors. But later errors can't have caused the first one. The notes about the shader not being linked are a consequence of the linker error that mentions that varying, so that's probably what you want to start with.

            C Offline
            C Offline
            Chohan
            wrote on last edited by
            #5

            @wrosecrans Thanks and naturally I looked for this error but there is hardly anything useful (that works for me) i found on internet.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AIN007
              wrote on last edited by
              #6

              hi!I have the same problem when I use Qt5.9。but the problem was disappeared when i use Qt5.14。How did you solve it?

              A 1 Reply Last reply
              0
              • A AIN007

                hi!I have the same problem when I use Qt5.9。but the problem was disappeared when i use Qt5.14。How did you solve it?

                A Offline
                A Offline
                AIN007
                wrote on last edited by
                #7

                @AIN007 I have solved the problem,just enable QML debugging

                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