Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QOpenGLShaderProgram - shader program is not linked



  • 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


  • Lifetime Qt Champion

    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.



  • @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.



  • @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.



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


Log in to reply