Minimal Qt5 install to compile code











up vote
3
down vote

favorite












I wrote a little program in C++ using Qt. Back when it was Qt4, in order for my friends to compile my program on their Ubuntu system, I would tell them, after getting my source files, to just run:



sudo apt install libqt4-dev
<navigate to sources directory>
qmake
make


Now that it is Qt5, I read somewhere that the new libqt4-dev is qtdeclarative5-dev so I told them to just type the code above with qtdeclarative5-dev instead of libqt4-dev.
However qmake didn't work, it did: qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory. I quickly found a fix by appending -qt5:



sudo apt install qtdeclarative5-dev
<navigate to sources directory>
qmake -qt5
make


Is this the correct way to do this? Is there a lighter or quicker Qt install?










share|improve this question















This question has an open bounty worth +100
reputation from Seub ending in 10 hours.


This question has not received enough attention.




















    up vote
    3
    down vote

    favorite












    I wrote a little program in C++ using Qt. Back when it was Qt4, in order for my friends to compile my program on their Ubuntu system, I would tell them, after getting my source files, to just run:



    sudo apt install libqt4-dev
    <navigate to sources directory>
    qmake
    make


    Now that it is Qt5, I read somewhere that the new libqt4-dev is qtdeclarative5-dev so I told them to just type the code above with qtdeclarative5-dev instead of libqt4-dev.
    However qmake didn't work, it did: qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory. I quickly found a fix by appending -qt5:



    sudo apt install qtdeclarative5-dev
    <navigate to sources directory>
    qmake -qt5
    make


    Is this the correct way to do this? Is there a lighter or quicker Qt install?










    share|improve this question















    This question has an open bounty worth +100
    reputation from Seub ending in 10 hours.


    This question has not received enough attention.


















      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I wrote a little program in C++ using Qt. Back when it was Qt4, in order for my friends to compile my program on their Ubuntu system, I would tell them, after getting my source files, to just run:



      sudo apt install libqt4-dev
      <navigate to sources directory>
      qmake
      make


      Now that it is Qt5, I read somewhere that the new libqt4-dev is qtdeclarative5-dev so I told them to just type the code above with qtdeclarative5-dev instead of libqt4-dev.
      However qmake didn't work, it did: qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory. I quickly found a fix by appending -qt5:



      sudo apt install qtdeclarative5-dev
      <navigate to sources directory>
      qmake -qt5
      make


      Is this the correct way to do this? Is there a lighter or quicker Qt install?










      share|improve this question













      I wrote a little program in C++ using Qt. Back when it was Qt4, in order for my friends to compile my program on their Ubuntu system, I would tell them, after getting my source files, to just run:



      sudo apt install libqt4-dev
      <navigate to sources directory>
      qmake
      make


      Now that it is Qt5, I read somewhere that the new libqt4-dev is qtdeclarative5-dev so I told them to just type the code above with qtdeclarative5-dev instead of libqt4-dev.
      However qmake didn't work, it did: qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory. I quickly found a fix by appending -qt5:



      sudo apt install qtdeclarative5-dev
      <navigate to sources directory>
      qmake -qt5
      make


      Is this the correct way to do this? Is there a lighter or quicker Qt install?







      compiling application-development qt qt5






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 26 at 21:54









      Seub

      2002416




      2002416






      This question has an open bounty worth +100
      reputation from Seub ending in 10 hours.


      This question has not received enough attention.








      This question has an open bounty worth +100
      reputation from Seub ending in 10 hours.


      This question has not received enough attention.
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          Correct way to compile using only qmake command.
          You can install qt5-default package to set qt5 as default while using development binaries.



          sudo apt-get install qt5-default qtdeclarative5-dev





          share|improve this answer























          • "Your program was written in qt4 so it was searching qt4 binaries in system": Actually no, I have obtained the same error with another program written in Qt5. I don't know why it tried to compile with qt4.
            – Seub
            Dec 1 at 17:35











          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: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          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%2f1096304%2fminimal-qt5-install-to-compile-code%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          Correct way to compile using only qmake command.
          You can install qt5-default package to set qt5 as default while using development binaries.



          sudo apt-get install qt5-default qtdeclarative5-dev





          share|improve this answer























          • "Your program was written in qt4 so it was searching qt4 binaries in system": Actually no, I have obtained the same error with another program written in Qt5. I don't know why it tried to compile with qt4.
            – Seub
            Dec 1 at 17:35















          up vote
          1
          down vote













          Correct way to compile using only qmake command.
          You can install qt5-default package to set qt5 as default while using development binaries.



          sudo apt-get install qt5-default qtdeclarative5-dev





          share|improve this answer























          • "Your program was written in qt4 so it was searching qt4 binaries in system": Actually no, I have obtained the same error with another program written in Qt5. I don't know why it tried to compile with qt4.
            – Seub
            Dec 1 at 17:35













          up vote
          1
          down vote










          up vote
          1
          down vote









          Correct way to compile using only qmake command.
          You can install qt5-default package to set qt5 as default while using development binaries.



          sudo apt-get install qt5-default qtdeclarative5-dev





          share|improve this answer














          Correct way to compile using only qmake command.
          You can install qt5-default package to set qt5 as default while using development binaries.



          sudo apt-get install qt5-default qtdeclarative5-dev






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 1 at 17:42

























          answered Dec 1 at 17:33









          Ketan Patel

          10.1k94365




          10.1k94365












          • "Your program was written in qt4 so it was searching qt4 binaries in system": Actually no, I have obtained the same error with another program written in Qt5. I don't know why it tried to compile with qt4.
            – Seub
            Dec 1 at 17:35


















          • "Your program was written in qt4 so it was searching qt4 binaries in system": Actually no, I have obtained the same error with another program written in Qt5. I don't know why it tried to compile with qt4.
            – Seub
            Dec 1 at 17:35
















          "Your program was written in qt4 so it was searching qt4 binaries in system": Actually no, I have obtained the same error with another program written in Qt5. I don't know why it tried to compile with qt4.
          – Seub
          Dec 1 at 17:35




          "Your program was written in qt4 so it was searching qt4 binaries in system": Actually no, I have obtained the same error with another program written in Qt5. I don't know why it tried to compile with qt4.
          – Seub
          Dec 1 at 17:35


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1096304%2fminimal-qt5-install-to-compile-code%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Quarter-circle Tiles

          build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

          Mont Emei