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. compilation problem
Qt 6.11 is out! See what's new in the release blog

compilation problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
17 Posts 7 Posters 2.9k Views 4 Watching
  • 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.
  • A Offline
    A Offline
    arsinte_andrei
    wrote on last edited by
    #3

    can you give some more information please like what operating system are you using, qt version and so on? I've had something like that on my GNU/Linux and all I've done was to install de opengl-dev

    1 Reply Last reply
    1
    • H Offline
      H Offline
      harry747
      wrote on last edited by
      #4

      i have a noname PC (quadcore i7) with 16GB ram, running ubuntu 19.04. i have Qt 5.12.3 and Qt creator 4.9.2 installed.

      so where do i find this opengl-dev? can i install it with sudo apt-get?

      jsulmJ 1 Reply Last reply
      0
      • A Offline
        A Offline
        arsinte_andrei
        wrote on last edited by
        #5

        @harry747 said in compilation problem:

        sudo apt-get

        do

        sudo apt-cache search glut
        

        and install dev packages from there
        like sudo apt-get install freeglut3-dev

        H 1 Reply Last reply
        2
        • H harry747

          i have a noname PC (quadcore i7) with 16GB ram, running ubuntu 19.04. i have Qt 5.12.3 and Qt creator 4.9.2 installed.

          so where do i find this opengl-dev? can i install it with sudo apt-get?

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

          @harry747 See https://doc.qt.io/qt-5/linux.html
          Do

          sudo apt-get install build-essential libgl1-mesa-dev
          

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

          1 Reply Last reply
          0
          • Kent-DorfmanK Offline
            Kent-DorfmanK Offline
            Kent-Dorfman
            wrote on last edited by
            #7

            something folks don't think about: after installing any linux/mesa opengl packages it is a good idea to re-install your nvidia drivers if you have nvidia, especially if you are using the nvidia.com drivers. Their tarball overwrites some of the mesa files and unless you reinstall the nvidia driver, either you won't get acceleration, or opengl will just break.

            A 1 Reply Last reply
            2
            • Kent-DorfmanK Kent-Dorfman

              something folks don't think about: after installing any linux/mesa opengl packages it is a good idea to re-install your nvidia drivers if you have nvidia, especially if you are using the nvidia.com drivers. Their tarball overwrites some of the mesa files and unless you reinstall the nvidia driver, either you won't get acceleration, or opengl will just break.

              A Offline
              A Offline
              arsinte_andrei
              wrote on last edited by
              #8

              @Kent-Dorfman
              some of us (hope the great majority) rely on the free (as in freedom GNU - GPL) nouveau driver - which is compatible with mesa. I think that what Linus said to nVidia in his lecture at the conference is still a valid point even today.. so...
              F...k you nVidia!!! - this is why I'm using GNU/Linux to be free!!!

              Kent-DorfmanK 1 Reply Last reply
              0
              • A arsinte_andrei

                @harry747 said in compilation problem:

                sudo apt-get

                do

                sudo apt-cache search glut
                

                and install dev packages from there
                like sudo apt-get install freeglut3-dev

                H Offline
                H Offline
                harry747
                wrote on last edited by
                #9

                sudo apt-get install freeglut3-dev

                i did that. but now i have another problem: as soon as i click the green triangle to build my project, i get a dialog box titled "custom executable". it says "could not find the executable. please specify one". so what "executable" is this about? where can i find this "executable"? i have loads of executables on my system, so how do i know which one i need to specify?

                jsulmJ 1 Reply Last reply
                0
                • A arsinte_andrei

                  @Kent-Dorfman
                  some of us (hope the great majority) rely on the free (as in freedom GNU - GPL) nouveau driver - which is compatible with mesa. I think that what Linus said to nVidia in his lecture at the conference is still a valid point even today.. so...
                  F...k you nVidia!!! - this is why I'm using GNU/Linux to be free!!!

                  Kent-DorfmanK Offline
                  Kent-DorfmanK Offline
                  Kent-Dorfman
                  wrote on last edited by
                  #10
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • H harry747

                    hi.
                    some time ago i started a project using an older version of Qt which i then put on ice. recently i decided to continue working on the project but now i have a problem: when i try to compile anything (even a brand new project with zero changes) i get the following error:

                    error: GL/gl.h: No such file or directory

                    and it shows me the file where it says:

                    # include <GL/gl.h>

                    but that file is not one of mine. so what's going on here, and what can i do to solve this?

                    Pablo J. RoginaP Offline
                    Pablo J. RoginaP Offline
                    Pablo J. Rogina
                    wrote on last edited by
                    #11

                    @harry747 said in compilation problem:

                    some time ago i started a project using an older version of Qt which i then put on ice. r

                    It's not just that you put your Qt project on hold, moreover it looks like you changed/upgraded your development environment in between :-)

                    Upvote the answer(s) that helped you solve the issue
                    Use "Topic Tools" button to mark your post as Solved
                    Add screenshots via postimage.org
                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply
                    0
                    • H harry747

                      sudo apt-get install freeglut3-dev

                      i did that. but now i have another problem: as soon as i click the green triangle to build my project, i get a dialog box titled "custom executable". it says "could not find the executable. please specify one". so what "executable" is this about? where can i find this "executable"? i have loads of executables on my system, so how do i know which one i need to specify?

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

                      @harry747 said in compilation problem:

                      so what "executable" is this about?

                      The executable of your application which is generated when it is built. Do the following:

                      • Delete build directory
                      • Execute make
                      • Build

                      Does it work then?
                      If not, please post your pro file.

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

                      H 1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @harry747 said in compilation problem:

                        so what "executable" is this about?

                        The executable of your application which is generated when it is built. Do the following:

                        • Delete build directory
                        • Execute make
                        • Build

                        Does it work then?
                        If not, please post your pro file.

                        H Offline
                        H Offline
                        harry747
                        wrote on last edited by aha_1980
                        #13

                        so what "executable" is this about?

                        The executable of your application which is generated when it is built.

                        but then why does this also happen with a brand new project? in that case i can't select a executable because it doesn't exist yet.

                        Do the following:

                        • Delete build directory

                        done that.

                        • Execute make

                        how do i do that? i found a menu item "run qmake". is that what you mean?

                        • Build

                        Does it work then?

                        i deleted the build directory, then ran qmake from th menu (see above) and when i tried to build, it still asked me for a "custom executable" :-(

                        If not, please post your pro file.

                        here it is:

                        #-------------------------------------------------
                        #
                        # Project created by QtCreator 2017-02-05T10:37:55
                        #
                        #-------------------------------------------------
                        
                        QT       += widgets gui core
                        
                        TARGET = LCARSlib
                        TEMPLATE = lib
                        
                        DEFINES += LCARSLIB_LIBRARY
                        
                        # The following define makes your compiler emit warnings if you use
                        # any feature of Qt which as been marked as deprecated (the exact warnings
                        # depend on your compiler). Please consult the documentation of the
                        # deprecated API in order to know how to port your code away from it.
                        DEFINES += QT_DEPRECATED_WARNINGS
                        
                        # You can also make your code fail to compile if you use deprecated APIs.
                        # In order to do so, uncomment the following line.
                        # You can also select to disable deprecated APIs only up to a certain version of Qt.
                        #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                        
                        SOURCES += lcarslib.cpp \
                            lcarsbutton.cpp \
                            lcarsuielement.cpp \
                            lcarsprefs.cpp \
                            lcarsscreen.cpp
                        
                        HEADERS += lcarslib.h\
                                lcarslib_global.h \
                            lcarsbutton.h \
                            lcarsuielement.h \
                            lcarsprefs.h \
                            lcarsscreen.h
                        
                        unix {
                            target.path = /usr/lib
                            INSTALLS += target
                        }
                        

                        [Edit aha_1980: added code tags]

                        jsulmJ 1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          arsinte_andrei
                          wrote on last edited by
                          #14

                          what you have there it's a lib and not a program so how do you intend to use the lib?? you should make a small program to test your lib... lib is a library under GNU/Linux or a dll (dynamic link library) in windows

                          1 Reply Last reply
                          3
                          • H harry747

                            so what "executable" is this about?

                            The executable of your application which is generated when it is built.

                            but then why does this also happen with a brand new project? in that case i can't select a executable because it doesn't exist yet.

                            Do the following:

                            • Delete build directory

                            done that.

                            • Execute make

                            how do i do that? i found a menu item "run qmake". is that what you mean?

                            • Build

                            Does it work then?

                            i deleted the build directory, then ran qmake from th menu (see above) and when i tried to build, it still asked me for a "custom executable" :-(

                            If not, please post your pro file.

                            here it is:

                            #-------------------------------------------------
                            #
                            # Project created by QtCreator 2017-02-05T10:37:55
                            #
                            #-------------------------------------------------
                            
                            QT       += widgets gui core
                            
                            TARGET = LCARSlib
                            TEMPLATE = lib
                            
                            DEFINES += LCARSLIB_LIBRARY
                            
                            # The following define makes your compiler emit warnings if you use
                            # any feature of Qt which as been marked as deprecated (the exact warnings
                            # depend on your compiler). Please consult the documentation of the
                            # deprecated API in order to know how to port your code away from it.
                            DEFINES += QT_DEPRECATED_WARNINGS
                            
                            # You can also make your code fail to compile if you use deprecated APIs.
                            # In order to do so, uncomment the following line.
                            # You can also select to disable deprecated APIs only up to a certain version of Qt.
                            #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                            
                            SOURCES += lcarslib.cpp \
                                lcarsbutton.cpp \
                                lcarsuielement.cpp \
                                lcarsprefs.cpp \
                                lcarsscreen.cpp
                            
                            HEADERS += lcarslib.h\
                                    lcarslib_global.h \
                                lcarsbutton.h \
                                lcarsuielement.h \
                                lcarsprefs.h \
                                lcarsscreen.h
                            
                            unix {
                                target.path = /usr/lib
                                INSTALLS += target
                            }
                            

                            [Edit aha_1980: added code tags]

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

                            @harry747 said in compilation problem:

                            Execute make

                            how do i do that? i found a menu item "run qmake". is that what you mean?

                            Sorry, I mean qmake not make.
                            As @arsinte_andrei said your project is a library and not an executable - you can't execute a library.

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

                            H 1 Reply Last reply
                            0
                            • jsulmJ jsulm

                              @harry747 said in compilation problem:

                              Execute make

                              how do i do that? i found a menu item "run qmake". is that what you mean?

                              Sorry, I mean qmake not make.
                              As @arsinte_andrei said your project is a library and not an executable - you can't execute a library.

                              H Offline
                              H Offline
                              harry747
                              wrote on last edited by
                              #16

                              @jsulm
                              yeah, i know it's a library. but that doesn't explain why i can't compile it. so the question remains, what "custom executable" does this dialog box want me to select, and where can i find it?

                              as for what i want to do with the library, i started writing an app for the purpose of testing the library, but the app couldn't find the library, which is why i put the whole thing on ice. but that's problem for another thread...

                              and here's a question about the forums: when i created my account here, i tried to use my main email address at protonmail.com, but the forum stubbornly refused to accept it, and i had to use my secondary address. WHY?

                              aha_1980A 1 Reply Last reply
                              0
                              • H harry747

                                @jsulm
                                yeah, i know it's a library. but that doesn't explain why i can't compile it. so the question remains, what "custom executable" does this dialog box want me to select, and where can i find it?

                                as for what i want to do with the library, i started writing an app for the purpose of testing the library, but the app couldn't find the library, which is why i put the whole thing on ice. but that's problem for another thread...

                                and here's a question about the forums: when i created my account here, i tried to use my main email address at protonmail.com, but the forum stubbornly refused to accept it, and i had to use my secondary address. WHY?

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

                                @harry747 said in compilation problem:

                                yeah, i know it's a library. but that doesn't explain why i can't compile it. so the question remains, what "custom executable" does this dialog box want me to select, and where can i find it?

                                If you cannot compile it, please post the actual compile errors.

                                The "custom executable" dialog appears when you press "Run" (the green triangle), and because you cannot run the library itself you should select the corresponding executable for that.

                                as for what i want to do with the library, i started writing an app for the purpose of testing the library, but the app couldn't find the library, which is why i put the whole thing on ice. but that's problem for another thread...

                                On which platform are you? On Windows, the lib has to be in the same directory as the exe file; on Linux that is not enough and the LD_LIBRARY_PATH has to be adjusted.

                                The best thing you can do is to put library and exe in a SUBDIRS project and adjust the .pro file of the exe so it finds the library automatically. Then you can build the whole project in one step.

                                Edit: an example of such a project can be found here: https://github.com/rainbyte/example-qmake-subdirs

                                Regards

                                Qt has to stay free or it will die.

                                1 Reply Last reply
                                3

                                • Login

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