Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Running example 'widgets\graphicsview\boxes' under windows7, needs '-opengl desktop' error
QtWS25 Last Chance

Running example 'widgets\graphicsview\boxes' under windows7, needs '-opengl desktop' error

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
23 Posts 3 Posters 2.9k 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.
  • T Offline
    T Offline
    TopDoozer
    wrote on last edited by
    #1

    Hello everyone!

    I have recently downloaded the newest Qt 5.12.3 through the online installer. It has been almost 10 years since i last did some programming (still have my 'I Qt everywhere' t-shirt =8) ). So i thought i tried some examples. The one that i was very interested in was the above mentioned 'boxes' example. Now, after having gotten the error message:":-1: Fehler: This example requires Qt to be configured with -opengl desktop", i tried to find some useful information on the internet to solev this problem. What i found said i would have to configure my Qt with "configure -opengl desktop". So i did that (i looked a little further and found that when i add -prefix and then a path, that i could then make the files in a specific location; i thought that sounded good). So after configure i used "mingw32-make" (i choose to not go with Visual Studio... the reasons fpr that shall remain in the dark... =;) ) and then after a while i typed "mingw32-make install". So now i have Qt with opengl desktop support... at least thats what i am assuming.
    Now the question i have not been able to find an answer for is: how do i tell the example and Qt Creator 4.9.1 (Opensource) to go take that specifc Qt which i had just created with the opengldesktop support and run that example with it?

    Please bear with me... i am older and it has been a while =;)

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

      Hi and welcome to devnet,

      Take a look at the related chapter in the Qt Creator documentation.

      One thing you can also try is to force the use of the desktop OpenGL backend when starting your application. See the dedicated paragraph in Qt for Windows - Requirements in Qt's documentation.

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

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TopDoozer
        wrote on last edited by
        #3

        Thanks for the tips.
        The first one, i thought, might be what i was looking for, however, i did not get a qmake.exe in the folder after mingw32-make install. The folder does have a subfolder "mkspecs" which i believe usualy would have a qmake.exe, but the folder is empty except for one subfolder by the name "modules". I am guessing that something went wrong with me configuring and making Qt from source.

        Here are the steps i took to configure and subsequently build:

        configure -prefix path_to_folder -opengl desktop

        mingw32-make

        mingw32-make install

        I am guessing i should have added something else to configure to get a more complete folder "mkspecs" (which may or may not be short for 'make specifications'?).

        I have not investigated your second suggestion yet @SGaist.

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

          The main thing you forgot is to add -no-make tests -no-make examples (it would have saved you time and disk space).

          The binaries (qmake and friends) are found in the bin folder. mkspecs are the configurations for the different platforms/devices.

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

          1 Reply Last reply
          0
          • T Offline
            T Offline
            TopDoozer
            wrote on last edited by
            #5

            Sadly, i want the examples... especially the one that i wrote this post about ;-). BTW so far i did not have any success in getting it to run.

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

              What I meant is that without that switch, it would compile all examples which is not what you want.

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

              1 Reply Last reply
              0
              • T Offline
                T Offline
                TopDoozer
                wrote on last edited by
                #7

                I do not think i follow you there SGaist. Are you saying, that if i used 'configure' without '-no-make examples' i would then be able to compile Qt with ALL examples?

                I thought i specifically said i want to run the exmaple 'boxes', but cannot, because Qt was not configured with opengl desktop. And i am trying to get around that error.

                I have now downloaded the newest version of Qt 5.12.3. This is what i have on my drive:
                0_1559506996419_Qt_folder_struc.png

                So now, i would open a command line console, go into the 'Src' folder and start the process of configuring and subsequently building Qt, righ?

                All because i would like to be able to run the example 'boxes' which needs a Qt version configured to run opengl desktop. I also would like to use mingw instead of msvc.

                So what would my configure command have to look like?

                Here is my guess:

                configure.bat -prefix 'path_to_folder' -opengl desktop -platform win32-g++

                Am i missing something, or should i then be able to open the exmaple 'boxes' in Qt creator, select a kit and run the example?

                Right now i am not concerned about saving time or diskspace. I am just not at the point where i understand the process enough to make meaningful decisions about streamlining the process.

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

                  The "-no-make example" just avoids the build system to build all examples as part of the build. They are still there, just not built.

                  One thing you should do is out of source builds. This will allow you to just nuke the build folder if something goes awry.

                  Your guess is correct, but at least add -no-make tests.

                  Did you try my suggestion of forcing the backend selection ?

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

                  T 1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    TopDoozer
                    wrote on last edited by
                    #9
                    This post is deleted!
                    1 Reply Last reply
                    0
                    • SGaistS SGaist

                      The "-no-make example" just avoids the build system to build all examples as part of the build. They are still there, just not built.

                      One thing you should do is out of source builds. This will allow you to just nuke the build folder if something goes awry.

                      Your guess is correct, but at least add -no-make tests.

                      Did you try my suggestion of forcing the backend selection ?

                      T Offline
                      T Offline
                      TopDoozer
                      wrote on last edited by TopDoozer
                      #10

                      @SGaist first off: no, i did not try your second suggestion. I might get back to that later. I basically just redownloaded anew (thats what you see in the filetree; thats whats on my drive after having downloaded only Qt source and the tools you see).
                      Now i tried to configure, mingw32-make.

                      This was the result (the last command is the 'configure' i used):
                      0_1559560070345_mingw32_make_error.png

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        TopDoozer
                        wrote on last edited by
                        #11

                        i just reran mingw32-make and i got a different error:

                        g++ -c -include .pch\debug\lib_pch.h -fno-keep-inline-dllexport -g -Og -std=c++1y -fno-exceptions -Wall -W -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQDESIGNER_SDK_LIBRARY -DQDESIGNER_EXTENSION_LIBRARY -DQDESIGNER_UILIB_LIBRARY -DQDESIGNER_SHARED_LIBRARY -DQT_DESIGNER -DQT_USE_QSTRINGBUILDER -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_DESIGNER_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_EXCEPTIONS -DQT_UIPLUGIN_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_UIPLUGIN_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -Iextension -Isdk -Ishared -I......\shared\qtpropertybrowser -I......\shared\deviceskin -I......\shared\findwidget -I......\shared\qtgradienteditor -Iuilib -I........\include -I........\include\QtDesigner -I........\include\QtDesigner\5.12.3 -I........\include\QtDesigner\5.12.3\QtDesigner -Itmp -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtWidgets\5.12.3 -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtWidgets\5.12.3\QtWidgets -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtGui\5.12.3 -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtGui\5.12.3\QtGui -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtCore\5.12.3 -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtCore\5.12.3\QtCore -I........\include\QtUiPlugin -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtWidgets -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtGui -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtXml -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\include\QtCore -I.moc\debug -I.uic -ID:\Qt\5.12.3_online_installer\5.12.3\Src\qtbase\mkspecs\win32-g++ -o .obj\debug\qtgradientstopscontroller.o ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp: In member function 'void QtGradientStopsControllerPrivate::enableCurrent(bool)':
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:99:9: error: invalid use of incomplete type 'class Ui::QtGradientEditor'
                        m_ui->positionLabel->setEnabled(enable);
                        ^~
                        In file included from ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:40:0:
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.h:48:11: note: forward declaration of 'class Ui::QtGradientEditor'
                        class QtGradientEditor;
                        ^~~~~~~~~~~~~~~~
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:100:9: error: invalid use of incomplete type 'class Ui::QtGradientEditor'
                        m_ui->colorLabel->setEnabled(enable);
                        ^~
                        In file included from ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:40:0:
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.h:48:11: note: forward declaration of 'class Ui::QtGradientEditor'
                        class QtGradientEditor;
                        ^~~~~~~~~~~~~~~~
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:101:9: error: invalid use of incomplete type 'class Ui::QtGradientEditor'
                        m_ui->hLabel->setEnabled(enable);
                        ^~
                        In file included from ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:40:0:
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.h:48:11: note: forward declaration of 'class Ui::QtGradientEditor'
                        class QtGradientEditor;
                        ^~~~~~~~~~~~~~~~
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:102:9: error: invalid use of incomplete type 'class Ui::QtGradientEditor'
                        m_ui->sLabel->setEnabled(enable);
                        ^~
                        In file included from ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:40:0:
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.h:48:11: note: forward declaration of 'class Ui::QtGradientEditor'
                        class QtGradientEditor;
                        ^~~~~~~~~~~~~~~~
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:103:9: error: invalid use of incomplete type 'class Ui::QtGradientEditor'
                        m_ui->vLabel->setEnabled(enable);
                        ^~
                        In file included from ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:40:0:
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.h:48:11: note: forward declaration of 'class Ui::QtGradientEditor'
                        class QtGradientEditor;
                        ^~~~~~~~~~~~~~~~
                        ......\shared\qtgradienteditor\qtgradientstopscontroller.cpp:104:9: error: invalid use of incomplete type 'class Ui::QtGradientEditor'
                        m_ui->aLabel->setEnabled(enable);

                        and it goes on for quite a while until

                        Makefile.Debug:28987: recipe for target '.obj/debug/qtgradientstopscontroller.o' failed
                        mingw32-make[6]: *** [.obj/debug/qtgradientstopscontroller.o] Error 1
                        mingw32-make[6]: Leaving directory 'D:/Qt/5.12.3_online_installer/5.12.3/Src/qttools/src/designer/src/lib'
                        Makefile:42: recipe for target 'debug-all' failed
                        mingw32-make[5]: *** [debug-all] Error 2
                        mingw32-make[5]: Leaving directory 'D:/Qt/5.12.3_online_installer/5.12.3/Src/qttools/src/designer/src/lib'
                        Makefile:97: recipe for target 'sub-lib-make_first' failed
                        mingw32-make[4]: *** [sub-lib-make_first] Error 2
                        mingw32-make[4]: Leaving directory 'D:/Qt/5.12.3_online_installer/5.12.3/Src/qttools/src/designer/src'
                        Makefile:42: recipe for target 'sub-src-make_first' failed
                        mingw32-make[3]: *** [sub-src-make_first] Error 2
                        mingw32-make[3]: Leaving directory 'D:/Qt/5.12.3_online_installer/5.12.3/Src/qttools/src/designer'
                        Makefile:77: recipe for target 'sub-designer-make_first' failed
                        mingw32-make[2]: *** [sub-designer-make_first] Error 2
                        mingw32-make[2]: Leaving directory 'D:/Qt/5.12.3_online_installer/5.12.3/Src/qttools/src'
                        Makefile:44: recipe for target 'sub-src-make_first' failed
                        mingw32-make[1]: *** [sub-src-make_first] Error 2
                        mingw32-make[1]: Leaving directory 'D:/Qt/5.12.3_online_installer/5.12.3/Src/qttools'
                        Makefile:971: recipe for target 'module-qttools-make_first' failed
                        mingw32-make: *** [module-qttools-make_first] Error 2

                        I was unaware, that building Qt from source would pose such a big problem...

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

                          These are parts of the tests. I currently don't know why it's failing like that however, you really should add -no-make tests to your configure options. AFAIK, you are not going to hack on Qt so it makes little sense to build all Qt's tests to get the build you are looking for.

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

                          1 Reply Last reply
                          1
                          • T Offline
                            T Offline
                            TopDoozer
                            wrote on last edited by
                            #13

                            I will try the configure with -nomake tests and then run mingw32-make and see what happens. Do i need to revert anything before i run configure and mingw32-make again? BTW thank you for taking the time to help me out here. Highly appreciated.

                            jsulmJ 1 Reply Last reply
                            0
                            • T TopDoozer

                              I will try the configure with -nomake tests and then run mingw32-make and see what happens. Do i need to revert anything before i run configure and mingw32-make again? BTW thank you for taking the time to help me out here. Highly appreciated.

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              @TopDoozer said in Running example 'widgets\graphicsview\boxes' under windows7, needs '-opengl desktop' error:

                              Do i need to revert anything before i run configure and mingw32-make again?

                              You should start from clean state. Best is to use out of source builds.

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              1
                              • T Offline
                                T Offline
                                TopDoozer
                                wrote on last edited by
                                #15

                                OK. So i now created a 'build' folder. Opened a console in that folder and called configure.bat from there. This is the configure.log file:

                                Command line: -prefix d:\Qt\Qt5.12.3\build -opengl desktop -nomake tests

                                I do have a configure.log file.... but i cannot upload it and its toolong to post in toto.
                                There are a couple of configure tests that fail:

                                executing config test alloca_h

                                • cd /d D:\Qt\Qt5.12.3\build\config.tests\alloca_h && D:\Qt\Qt5.12.3\build\qtbase\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" D:/Qt/Qt5.12.3/build/config.tests/alloca_h
                                • cd /d D:\Qt\Qt5.12.3\build\config.tests\alloca_h && set MAKEFLAGS=& mingw32-make

                                g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -ID:\Qt\Qt5.12.3\5.12.3\Src\qtbase\mkspecs\win32-g++ -o main.o main.cpp
                                main.cpp:2:20: fatal error: alloca.h: No such file or directory
                                #include <alloca.h>
                                ^
                                compilation terminated.
                                Makefile:165: recipe for target 'main.o' failed
                                mingw32-make: *** [main.o] Error 1
                                test config.qtbase.tests.alloca_h FAILED

                                is the first one...

                                jsulmJ 1 Reply Last reply
                                0
                                • T TopDoozer

                                  OK. So i now created a 'build' folder. Opened a console in that folder and called configure.bat from there. This is the configure.log file:

                                  Command line: -prefix d:\Qt\Qt5.12.3\build -opengl desktop -nomake tests

                                  I do have a configure.log file.... but i cannot upload it and its toolong to post in toto.
                                  There are a couple of configure tests that fail:

                                  executing config test alloca_h

                                  • cd /d D:\Qt\Qt5.12.3\build\config.tests\alloca_h && D:\Qt\Qt5.12.3\build\qtbase\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" D:/Qt/Qt5.12.3/build/config.tests/alloca_h
                                  • cd /d D:\Qt\Qt5.12.3\build\config.tests\alloca_h && set MAKEFLAGS=& mingw32-make

                                  g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -ID:\Qt\Qt5.12.3\5.12.3\Src\qtbase\mkspecs\win32-g++ -o main.o main.cpp
                                  main.cpp:2:20: fatal error: alloca.h: No such file or directory
                                  #include <alloca.h>
                                  ^
                                  compilation terminated.
                                  Makefile:165: recipe for target 'main.o' failed
                                  mingw32-make: *** [main.o] Error 1
                                  test config.qtbase.tests.alloca_h FAILED

                                  is the first one...

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  @TopDoozer Failing tests are normal. The question is: is any feature you need disabled because of failing tests? If not then just build.

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • T Offline
                                    T Offline
                                    TopDoozer
                                    wrote on last edited by
                                    #17

                                    @jsulm are you suggesting, that build might fail if i try to run it with a feature that might not have passed the configure test (running nmake right now but expecting it to fail again)?

                                    jsulmJ 1 Reply Last reply
                                    0
                                    • T TopDoozer

                                      @jsulm are you suggesting, that build might fail if i try to run it with a feature that might not have passed the configure test (running nmake right now but expecting it to fail again)?

                                      jsulmJ Offline
                                      jsulmJ Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #18

                                      @TopDoozer No, it should not fail, but some features will not be built.

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      0
                                      • T Offline
                                        T Offline
                                        TopDoozer
                                        wrote on last edited by
                                        #19

                                        i ran nmake with this result:
                                        0_1559919306508_nmake.png

                                        1 Reply Last reply
                                        0
                                        • T Offline
                                          T Offline
                                          TopDoozer
                                          wrote on last edited by
                                          #20

                                          Any idea whats going on, or what i am missing? Anything i can do to provide more information to gain insight into the error?

                                          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