Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QOpenGLShaderProgram: could not create shader program
Forum Update on Monday, May 27th 2025

QOpenGLShaderProgram: could not create shader program

Scheduled Pinned Locked Moved QML and Qt Quick
25 Posts 5 Posters 13.0k 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.
  • V Offline
    V Offline
    vladinko0
    wrote on 26 Mar 2015, 20:54 last edited by
    #1

    Hi

    When I run program in Qt 5.4.1 MinGW 32 bit I get this message: "QOpenGLShaderProgram: could not create shader program".

    I am not able to improve my graphic driver.
    Is there any solution to solve this problem?

    Thanks.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 26 Mar 2015, 21:19 last edited by
      #2

      @vladinko0 said:

      Is there any solution to solve this problem?

      Pretty hard to say when you basically present no information at all...

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vladinko0
        wrote on 28 Mar 2015, 13:21 last edited by vladinko0
        #3

        I don't know, what additional information you need?

        This error regards all kinds of Qt projects. I am using HP Compaq dc7800p Small Form Fader, Windows Vista Business 32 bit, DirectX 11, Intel Q35 Express Chipset Family Graphic driver.

        Please, specify, what else you need?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on 28 Mar 2015, 13:23 last edited by
          #4

          Please give a minimal but complete example so that one can try to reproduce the problem.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vladinko0
            wrote on 28 Mar 2015, 13:38 last edited by
            #5

            It regards all projects. For example "Hello World" program.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on 28 Mar 2015, 13:39 last edited by
              #6

              @vladinko0 said:

              QOpenGLShaderProgram

              Ah, now I understand. So you're not tinkering with QOpenGLShaderProgram yourself at all, right?

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vladinko0
                wrote on 28 Mar 2015, 13:41 last edited by
                #7

                Yes, You are right.

                ? 1 Reply Last reply 28 Mar 2015, 14:04
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on 28 Mar 2015, 13:50 last edited by A Former User
                  #8

                  Which Qt version did you install exactly?

                  Qt 5.4.1 for Windows 64-bit (VS 2013, 722 MB) (info)
                  Qt 5.4.1 for Windows 64-bit (VS 2013, OpenGL, 711 MB) (info)
                  Qt 5.4.1 for Windows 32-bit (VS 2013, 705 MB) (info)
                  Qt 5.4.1 for Windows 32-bit (VS 2013, OpenGL, 695 MB) (info)
                  Qt 5.4.1 for Windows 32-bit (VS 2012, OpenGL, 644 MB) (info)
                  Qt 5.4.1 for Windows 32-bit (VS 2010, OpenGL, 627 MB) (info)
                  Qt 5.4.1 for Windows 32-bit (MinGW 4.9.1, 856 MB) (info)
                  Qt 5.4.1 for Android (Windows 32-bit, 939 MB) (info)
                  Qt 5.4.1 for Windows RT 32-bit (766 MB) (info)

                  1 Reply Last reply
                  0
                  • V vladinko0
                    28 Mar 2015, 13:41

                    Yes, You are right.

                    ? Offline
                    ? Offline
                    A Former User
                    wrote on 28 Mar 2015, 14:04 last edited by
                    #9

                    @vladinko0 If your Qt version isn't OpenGL-only, then you can force your program to use ANGLE:
                    QCoreApplication::setAttribute( Qt::AA_UseOpenGLES ); // use DirectX via ANGLE

                    V 1 Reply Last reply 28 Mar 2015, 15:07
                    0
                    • V Offline
                      V Offline
                      vladinko0
                      wrote on 28 Mar 2015, 14:07 last edited by
                      #10

                      I installed Qt 5.4.1 MinGW 4.9.1 (32 bit), OpenGL for Windows .

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        Chris Kawa
                        Lifetime Qt Champion
                        wrote on 28 Mar 2015, 14:08 last edited by
                        #11

                        According to Intel documentation the Q35 Express chipset only supports OpenGL 1.3. That's waaay to low for Qt.

                        You can run the ANGLE (or dynamic) version of Qt (OpenGL layer on top of DirectX). It's the package without "OpenGL" in the name mentioned by @Wieland. This still won't let you run some of the OpenGL examples. It's high time for an upgrade ;)

                        S 1 Reply Last reply 13 Sept 2015, 19:12
                        0
                        • ? A Former User
                          28 Mar 2015, 14:04

                          @vladinko0 If your Qt version isn't OpenGL-only, then you can force your program to use ANGLE:
                          QCoreApplication::setAttribute( Qt::AA_UseOpenGLES ); // use DirectX via ANGLE

                          V Offline
                          V Offline
                          vladinko0
                          wrote on 28 Mar 2015, 15:07 last edited by
                          #12

                          @Wieland said:

                          @vladinko0 If your Qt version isn't OpenGL-only, then you can force your program to use ANGLE:
                          QCoreApplication::setAttribute( Qt::AA_UseOpenGLES ); // use DirectX via ANGLE

                          Is it possible to put this line into Qt Quick UI project?
                          Because there are only qml files like this:
                          import QtQuick 2.4
                          import QtQuick.Controls 1.3
                          import QtQuick.Window 2.2
                          import QtQuick.Dialogs 1.2

                          ApplicationWindow {
                          title: qsTr("Hello World")
                          width: 640
                          height: 480

                          menuBar: MenuBar {
                              Menu {
                                  title: qsTr("&File")
                                  MenuItem {
                                      text: qsTr("&Open")
                                      onTriggered: messageDialog.show(qsTr("Open action triggered"));
                                  }
                                  MenuItem {
                                      text: qsTr("E&xit")
                                      onTriggered: Qt.quit();
                                  }
                              }
                          }
                          
                          MainForm {
                              anchors.fill: parent
                              button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
                              button2.onClicked: messageDialog.show(qsTr("Button 2 pressed"))
                              button3.onClicked: messageDialog.show(qsTr("Button 3 pressed"))
                          }
                          
                          MessageDialog {
                              id: messageDialog
                              title: qsTr("May I have your attention, please?")
                          
                              function show(caption) {
                                  messageDialog.text = caption;
                                  messageDialog.open();
                              }
                          }
                          

                          }

                          Or where to put this line?

                          ? 1 Reply Last reply 28 Mar 2015, 18:45
                          0
                          • V vladinko0
                            28 Mar 2015, 15:07

                            @Wieland said:

                            @vladinko0 If your Qt version isn't OpenGL-only, then you can force your program to use ANGLE:
                            QCoreApplication::setAttribute( Qt::AA_UseOpenGLES ); // use DirectX via ANGLE

                            Is it possible to put this line into Qt Quick UI project?
                            Because there are only qml files like this:
                            import QtQuick 2.4
                            import QtQuick.Controls 1.3
                            import QtQuick.Window 2.2
                            import QtQuick.Dialogs 1.2

                            ApplicationWindow {
                            title: qsTr("Hello World")
                            width: 640
                            height: 480

                            menuBar: MenuBar {
                                Menu {
                                    title: qsTr("&File")
                                    MenuItem {
                                        text: qsTr("&Open")
                                        onTriggered: messageDialog.show(qsTr("Open action triggered"));
                                    }
                                    MenuItem {
                                        text: qsTr("E&xit")
                                        onTriggered: Qt.quit();
                                    }
                                }
                            }
                            
                            MainForm {
                                anchors.fill: parent
                                button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
                                button2.onClicked: messageDialog.show(qsTr("Button 2 pressed"))
                                button3.onClicked: messageDialog.show(qsTr("Button 3 pressed"))
                            }
                            
                            MessageDialog {
                                id: messageDialog
                                title: qsTr("May I have your attention, please?")
                            
                                function show(caption) {
                                    messageDialog.text = caption;
                                    messageDialog.open();
                                }
                            }
                            

                            }

                            Or where to put this line?

                            ? Offline
                            ? Offline
                            A Former User
                            wrote on 28 Mar 2015, 18:45 last edited by A Former User
                            #13

                            @vladinko0 It belongs in your main.cpp:

                            int main(int argc, char *argv[])
                            {
                                // Options on Windows; set before instantiating QApplication
                                // QCoreApplication::setAttribute( Qt::AA_UseOpenGLES ); // use DirectX via ANGLE
                                
                                QApplication app( argc, argv );
                            
                            V 1 Reply Last reply 28 Mar 2015, 19:46
                            0
                            • ? A Former User
                              28 Mar 2015, 18:45

                              @vladinko0 It belongs in your main.cpp:

                              int main(int argc, char *argv[])
                              {
                                  // Options on Windows; set before instantiating QApplication
                                  // QCoreApplication::setAttribute( Qt::AA_UseOpenGLES ); // use DirectX via ANGLE
                                  
                                  QApplication app( argc, argv );
                              
                              V Offline
                              V Offline
                              vladinko0
                              wrote on 28 Mar 2015, 19:46 last edited by
                              #14

                              @Wieland But Qt Quick UI project has no main.cpp file.

                              ? 1 Reply Last reply 28 Mar 2015, 19:47
                              0
                              • V vladinko0
                                28 Mar 2015, 19:46

                                @Wieland But Qt Quick UI project has no main.cpp file.

                                ? Offline
                                ? Offline
                                A Former User
                                wrote on 28 Mar 2015, 19:47 last edited by
                                #15

                                @vladinko0 I know. Can't you use Qt Quick Application?

                                V 1 Reply Last reply 28 Mar 2015, 19:49
                                0
                                • ? A Former User
                                  28 Mar 2015, 19:47

                                  @vladinko0 I know. Can't you use Qt Quick Application?

                                  V Offline
                                  V Offline
                                  vladinko0
                                  wrote on 28 Mar 2015, 19:49 last edited by
                                  #16

                                  @Wieland Yes, I used also Qt Quick Application project with the same error.

                                  1 Reply Last reply
                                  0
                                  • ? Offline
                                    ? Offline
                                    A Former User
                                    wrote on 28 Mar 2015, 19:51 last edited by A Former User
                                    #17

                                    Hmm. If you have an ANGLE capable Qt version and set the Qt::AA_UseOpenGLES attribute and it still doesn't work then I don't know. Sorry :-(

                                    1 Reply Last reply
                                    0
                                    • boumathB Offline
                                      boumathB Offline
                                      boumath
                                      wrote on 9 May 2015, 09:08 last edited by
                                      #18

                                      I had exactly the same issue with Qt 5.4.1 MinGW 32-bit

                                      @Wieland solution to force ANGLE is the good one, but it doesn't work. In fact I'm not sure this version support it. If you look into the \Qt5.4.1\5.4\mingw491_32\bin directory you will not find libEGL.dll, libGLESv2.dll and d3dcompiler_47.dll. I used to work with ANGLE but with Microsoft Visual Studio 2013 compilator, and these libraries are provided in the Qt distribution : "Qt 5.4.1 for Windows 32-bit (VS 2013, 705 MB)"

                                      @Wieland do you have MinGW or VS2013 compilator ?

                                      ? 1 Reply Last reply 9 May 2015, 09:12
                                      0
                                      • boumathB boumath
                                        9 May 2015, 09:08

                                        I had exactly the same issue with Qt 5.4.1 MinGW 32-bit

                                        @Wieland solution to force ANGLE is the good one, but it doesn't work. In fact I'm not sure this version support it. If you look into the \Qt5.4.1\5.4\mingw491_32\bin directory you will not find libEGL.dll, libGLESv2.dll and d3dcompiler_47.dll. I used to work with ANGLE but with Microsoft Visual Studio 2013 compilator, and these libraries are provided in the Qt distribution : "Qt 5.4.1 for Windows 32-bit (VS 2013, 705 MB)"

                                        @Wieland do you have MinGW or VS2013 compilator ?

                                        ? Offline
                                        ? Offline
                                        A Former User
                                        wrote on 9 May 2015, 09:12 last edited by
                                        #19

                                        @boumath Hi, I use VS 2013.

                                        1 Reply Last reply
                                        0
                                        • boumathB Offline
                                          boumathB Offline
                                          boumath
                                          wrote on 10 May 2015, 07:17 last edited by
                                          #20

                                          Thanks Wieland, that's explains why forcing ANGLE in your case is working and not for vladinko0

                                          @vladinko0, I suggest you to install Visual Studio 2013 (Express is free), and install Qt 5.4.1 for VS2013. Force Qt::AA_UseOpenGLES like Wieland says. Because your graphic chipset is old, perhaps you will need to set the environment variable QT_ANGLE_PLATFORM to d3d9 (if it doesn't support DirectX 11).

                                          V 1 Reply Last reply 13 Sept 2015, 02:41
                                          0

                                          • Login

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