Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

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

    Installation and Deployment
    3
    23
    798
    Loading More Posts
    • 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.
    • SGaist
      SGaist Lifetime Qt Champion last edited by

      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 Reply Quote 0
      • T
        TopDoozer last edited by

        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 Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          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 Reply Quote 0
          • T
            TopDoozer last edited by

            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 Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              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 Reply Quote 0
              • T
                TopDoozer last edited by

                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 Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  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 Reply Quote 0
                  • T
                    TopDoozer last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • T
                      TopDoozer @SGaist last edited by TopDoozer

                      @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 Reply Quote 0
                      • T
                        TopDoozer last edited by

                        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 Reply Quote 0
                        • SGaist
                          SGaist Lifetime Qt Champion last edited by

                          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 Reply Quote 1
                          • T
                            TopDoozer last edited by

                            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.

                            jsulm 1 Reply Last reply Reply Quote 0
                            • jsulm
                              jsulm Lifetime Qt Champion @TopDoozer last edited by

                              @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 Reply Quote 1
                              • T
                                TopDoozer last edited by

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

                                jsulm 1 Reply Last reply Reply Quote 0
                                • jsulm
                                  jsulm Lifetime Qt Champion @TopDoozer last edited by

                                  @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 Reply Quote 0
                                  • T
                                    TopDoozer last edited by

                                    @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)?

                                    jsulm 1 Reply Last reply Reply Quote 0
                                    • jsulm
                                      jsulm Lifetime Qt Champion @TopDoozer last edited by

                                      @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 Reply Quote 0
                                      • T
                                        TopDoozer last edited by

                                        i ran nmake with this result:
                                        0_1559919306508_nmake.png

                                        1 Reply Last reply Reply Quote 0
                                        • T
                                          TopDoozer last edited by

                                          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 Reply Quote 0
                                          • T
                                            TopDoozer last edited by

                                            Tried to keep it simple and just ran configure followed by nmake. Same error: Unknown module in Qt: bootstrap-private. WTF?

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post