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. Help! Problem with Qt and OpenGL (fatal error)
Qt 6.11 is out! See what's new in the release blog

Help! Problem with Qt and OpenGL (fatal error)

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 2.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.
  • J Offline
    J Offline
    JRefusta
    wrote on last edited by JRefusta
    #1

    Hello, I was trying to compile an OpenGL with qt program for the first time and i had some issues in the process

    As I said, that was the first time in this machine, but I'd did that in another one, the process was:
    write "qmake-qt4", then a Makefile was created, and then do the "make", to do the Makefile works.
    But when I wrote "make", this appears to the console:

    g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/include/glm -I/usr/X11R6/include -I. -I. -o main.o main.cpp
    main.cpp:1:10: fatal error: QApplication: No such file or directory
    #include <QApplication>
    ^~~~~~~~~~~~~~
    compilation terminated.
    Makefile:226: recipe for target 'main.o' failed
    make: *** [main.o] Error 1

    All I did for this It was:
    sudo apt install qtchooser
    and:
    sudo apt install qt4-qmake

    I dont know what else can I do, I tried in another machine, but the error Is the same, except instead of <QApplication>, It wrote <QOpenGLFunctions_3_3_Core>

    Thank you for your time!

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You did not install the qt4 development package so the include files are not installed (and therefore not found by the compiler).
      btw: I would strongly advise to not use Qt4 but Qt5 instead.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      J 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        You did not install the qt4 development package so the include files are not installed (and therefore not found by the compiler).
        btw: I would strongly advise to not use Qt4 but Qt5 instead.

        J Offline
        J Offline
        JRefusta
        wrote on last edited by JRefusta
        #3

        @Christian-Ehrlicher thank you for the answer!
        Hoe can I download the qt4 package? or the qt5? Thank u

        aha_1980A 1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Why did you delete your first post? Since I don't know your distribution I can't help.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • J JRefusta

            @Christian-Ehrlicher thank you for the answer!
            Hoe can I download the qt4 package? or the qt5? Thank u

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by aha_1980
            #5

            @JRefusta

            The Qt 4 headers and libraries would be installed by (Ubuntu 16.04)
            sudo apt install libqt4-dev

            For Qt 5, the modules are split in several packages. But you can also install any Qt 5 version with the online installer: https://download.qt.io/official_releases/online_installers

            Regards

            PS: Please don't delete your posts, especially not if you got an answer.

            Thanks

            Qt has to stay free or it will die.

            1 Reply Last reply
            1
            • J Offline
              J Offline
              JRefusta
              wrote on last edited by
              #6

              Sorry guys, I deleted the post because I found a "solution":
              I found in another forum, doing

              sudo apt-get install qtbase5-dev
              sudo apt-get install qt5-default

              to get the qmake-qt5,
              but I sill cannnot do de "qmake-qt5", so I decided to do it just in "qmake", that's works, but now I have another problem. The new problem I posted here:
              https://forum.qt.io/topic/94893/help-qopenglshader-unable-to-open-file-shaders-fragshad-frag-qopenglshader-unable-to-open-file-shaders-vertshad-vert

              I have Ubuntu 18.04.
              Now Im going to try It in qt5, as @aha_1980 said, thanks guys. :-)

              aha_1980A 1 Reply Last reply
              0
              • J JRefusta

                Sorry guys, I deleted the post because I found a "solution":
                I found in another forum, doing

                sudo apt-get install qtbase5-dev
                sudo apt-get install qt5-default

                to get the qmake-qt5,
                but I sill cannnot do de "qmake-qt5", so I decided to do it just in "qmake", that's works, but now I have another problem. The new problem I posted here:
                https://forum.qt.io/topic/94893/help-qopenglshader-unable-to-open-file-shaders-fragshad-frag-qopenglshader-unable-to-open-file-shaders-vertshad-vert

                I have Ubuntu 18.04.
                Now Im going to try It in qt5, as @aha_1980 said, thanks guys. :-)

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi @JRefusta,

                thanks for sharing the answer. The reason to keep the question and to share the answer is to help further readers, just like you found your solution.

                So please mark this topic as SOLVED now. Thanks!

                Qt has to stay free or it will die.

                1 Reply Last reply
                1

                • Login

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