Compilation errors in Ubuntu 18.04 LTS for a QT-based project

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












When running make, the following errors appear in terminal:


//usr/local/lib/liblua.a(loadlib.o) : In function « lookforfunc » :
loadlib.c:(.text+0x576): warning : Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking


/usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Widgets

/usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Gui

/usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Core

/usr/bin/x86_64-linux-gnu-ld : cannot find -lGL

collect2: error: ld returned 1 exit status







share|improve this question

























    up vote
    1
    down vote

    favorite












    When running make, the following errors appear in terminal:


    //usr/local/lib/liblua.a(loadlib.o) : In function « lookforfunc » :
    loadlib.c:(.text+0x576): warning : Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking


    /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Widgets

    /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Gui

    /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Core

    /usr/bin/x86_64-linux-gnu-ld : cannot find -lGL

    collect2: error: ld returned 1 exit status







    share|improve this question





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      When running make, the following errors appear in terminal:


      //usr/local/lib/liblua.a(loadlib.o) : In function « lookforfunc » :
      loadlib.c:(.text+0x576): warning : Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking


      /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Widgets

      /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Gui

      /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Core

      /usr/bin/x86_64-linux-gnu-ld : cannot find -lGL

      collect2: error: ld returned 1 exit status







      share|improve this question











      When running make, the following errors appear in terminal:


      //usr/local/lib/liblua.a(loadlib.o) : In function « lookforfunc » :
      loadlib.c:(.text+0x576): warning : Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking


      /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Widgets

      /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Gui

      /usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Core

      /usr/bin/x86_64-linux-gnu-ld : cannot find -lGL

      collect2: error: ld returned 1 exit status









      share|improve this question










      share|improve this question




      share|improve this question









      asked 2 days ago









      ProgAndPlay

      808




      808




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          I did search on packages.ubuntu.com.



          According to it you need the following packages:




          • for compilation:



            sudo apt-get install qtbase5-dev libgl1-mesa-dev 



          • at run time:



            sudo apt-get install libqt5widgets5 libqt5gui5 libqt5core5a libgl1






          share|improve this answer























          • well, I have found the libs, I have copied libQt5Widgets.so and others from /usr/lib/x86_64-linux-gnu to /usr/lib but the errors still appear.
            – ProgAndPlay
            yesterday










          • You should not copy anything from anywhere to the places maintained by package manager (APT)!!! With such actions you can trash and mess your system!!! If you want to copy some lib, copy it to the folder folder with your compiled binary.
            – N0rbert
            yesterday










          • sorry, I'm kinda eager to solve this... lol
            – ProgAndPlay
            yesterday

















          up vote
          0
          down vote













          I have solved it by adding these entries in the projects ".pro" file and then generating again the Makefile with qmake.

          The entries are:
          QMAKE_CFLAGS += -no-pie

          QMAKE_CXXFLAGS += -no-pie

          QMAKE_LFLAGS += -no-pie -fPIC

          LIBS += -llua -ldl -L/usr/lib/x86_64-linux-gnu/






          share|improve this answer





















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1062095%2fcompilation-errors-in-ubuntu-18-04-lts-for-a-qt-based-project%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            I did search on packages.ubuntu.com.



            According to it you need the following packages:




            • for compilation:



              sudo apt-get install qtbase5-dev libgl1-mesa-dev 



            • at run time:



              sudo apt-get install libqt5widgets5 libqt5gui5 libqt5core5a libgl1






            share|improve this answer























            • well, I have found the libs, I have copied libQt5Widgets.so and others from /usr/lib/x86_64-linux-gnu to /usr/lib but the errors still appear.
              – ProgAndPlay
              yesterday










            • You should not copy anything from anywhere to the places maintained by package manager (APT)!!! With such actions you can trash and mess your system!!! If you want to copy some lib, copy it to the folder folder with your compiled binary.
              – N0rbert
              yesterday










            • sorry, I'm kinda eager to solve this... lol
              – ProgAndPlay
              yesterday














            up vote
            0
            down vote













            I did search on packages.ubuntu.com.



            According to it you need the following packages:




            • for compilation:



              sudo apt-get install qtbase5-dev libgl1-mesa-dev 



            • at run time:



              sudo apt-get install libqt5widgets5 libqt5gui5 libqt5core5a libgl1






            share|improve this answer























            • well, I have found the libs, I have copied libQt5Widgets.so and others from /usr/lib/x86_64-linux-gnu to /usr/lib but the errors still appear.
              – ProgAndPlay
              yesterday










            • You should not copy anything from anywhere to the places maintained by package manager (APT)!!! With such actions you can trash and mess your system!!! If you want to copy some lib, copy it to the folder folder with your compiled binary.
              – N0rbert
              yesterday










            • sorry, I'm kinda eager to solve this... lol
              – ProgAndPlay
              yesterday












            up vote
            0
            down vote










            up vote
            0
            down vote









            I did search on packages.ubuntu.com.



            According to it you need the following packages:




            • for compilation:



              sudo apt-get install qtbase5-dev libgl1-mesa-dev 



            • at run time:



              sudo apt-get install libqt5widgets5 libqt5gui5 libqt5core5a libgl1






            share|improve this answer















            I did search on packages.ubuntu.com.



            According to it you need the following packages:




            • for compilation:



              sudo apt-get install qtbase5-dev libgl1-mesa-dev 



            • at run time:



              sudo apt-get install libqt5widgets5 libqt5gui5 libqt5core5a libgl1







            share|improve this answer















            share|improve this answer



            share|improve this answer








            edited 2 days ago


























            answered 2 days ago









            N0rbert

            13.5k32664




            13.5k32664











            • well, I have found the libs, I have copied libQt5Widgets.so and others from /usr/lib/x86_64-linux-gnu to /usr/lib but the errors still appear.
              – ProgAndPlay
              yesterday










            • You should not copy anything from anywhere to the places maintained by package manager (APT)!!! With such actions you can trash and mess your system!!! If you want to copy some lib, copy it to the folder folder with your compiled binary.
              – N0rbert
              yesterday










            • sorry, I'm kinda eager to solve this... lol
              – ProgAndPlay
              yesterday
















            • well, I have found the libs, I have copied libQt5Widgets.so and others from /usr/lib/x86_64-linux-gnu to /usr/lib but the errors still appear.
              – ProgAndPlay
              yesterday










            • You should not copy anything from anywhere to the places maintained by package manager (APT)!!! With such actions you can trash and mess your system!!! If you want to copy some lib, copy it to the folder folder with your compiled binary.
              – N0rbert
              yesterday










            • sorry, I'm kinda eager to solve this... lol
              – ProgAndPlay
              yesterday















            well, I have found the libs, I have copied libQt5Widgets.so and others from /usr/lib/x86_64-linux-gnu to /usr/lib but the errors still appear.
            – ProgAndPlay
            yesterday




            well, I have found the libs, I have copied libQt5Widgets.so and others from /usr/lib/x86_64-linux-gnu to /usr/lib but the errors still appear.
            – ProgAndPlay
            yesterday












            You should not copy anything from anywhere to the places maintained by package manager (APT)!!! With such actions you can trash and mess your system!!! If you want to copy some lib, copy it to the folder folder with your compiled binary.
            – N0rbert
            yesterday




            You should not copy anything from anywhere to the places maintained by package manager (APT)!!! With such actions you can trash and mess your system!!! If you want to copy some lib, copy it to the folder folder with your compiled binary.
            – N0rbert
            yesterday












            sorry, I'm kinda eager to solve this... lol
            – ProgAndPlay
            yesterday




            sorry, I'm kinda eager to solve this... lol
            – ProgAndPlay
            yesterday












            up vote
            0
            down vote













            I have solved it by adding these entries in the projects ".pro" file and then generating again the Makefile with qmake.

            The entries are:
            QMAKE_CFLAGS += -no-pie

            QMAKE_CXXFLAGS += -no-pie

            QMAKE_LFLAGS += -no-pie -fPIC

            LIBS += -llua -ldl -L/usr/lib/x86_64-linux-gnu/






            share|improve this answer

























              up vote
              0
              down vote













              I have solved it by adding these entries in the projects ".pro" file and then generating again the Makefile with qmake.

              The entries are:
              QMAKE_CFLAGS += -no-pie

              QMAKE_CXXFLAGS += -no-pie

              QMAKE_LFLAGS += -no-pie -fPIC

              LIBS += -llua -ldl -L/usr/lib/x86_64-linux-gnu/






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                I have solved it by adding these entries in the projects ".pro" file and then generating again the Makefile with qmake.

                The entries are:
                QMAKE_CFLAGS += -no-pie

                QMAKE_CXXFLAGS += -no-pie

                QMAKE_LFLAGS += -no-pie -fPIC

                LIBS += -llua -ldl -L/usr/lib/x86_64-linux-gnu/






                share|improve this answer













                I have solved it by adding these entries in the projects ".pro" file and then generating again the Makefile with qmake.

                The entries are:
                QMAKE_CFLAGS += -no-pie

                QMAKE_CXXFLAGS += -no-pie

                QMAKE_LFLAGS += -no-pie -fPIC

                LIBS += -llua -ldl -L/usr/lib/x86_64-linux-gnu/







                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered 2 hours ago









                ProgAndPlay

                808




                808






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1062095%2fcompilation-errors-in-ubuntu-18-04-lts-for-a-qt-based-project%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    pylint3 and pip3 broken

                    Missing snmpget and snmpwalk

                    How to enroll fingerprints to Ubuntu 17.10 with VFS491