Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. how to make QtCreator to use correct version of gcc and g++?

how to make QtCreator to use correct version of gcc and g++?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 3 Posters 1.8k Views 1 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.
  • K Offline
    K Offline
    Kofr
    wrote on last edited by
    #1

    OS Linux mint
    There are gcc versions 4.7 and 8 installed

    $ sudo update-alternatives --config g++
    Есть 2 варианта для альтернативы g++ (предоставляет /usr/bin/g++).
    
      Выбор   Путь          Приор Состояние
    ------------------------------------------------------------
    * 0            /usr/bin/g++-8     800       автоматический режим
      1            /usr/bin/g++-4.7   20        ручной режим
      2            /usr/bin/g++-8     800       ручной режим
    
    Press <enter> to keep the current choice[*], or type selection number: 
    
    

    In QtCreator g++ version of 8 is installed in Kit

    And QtCreator uses GCC 4.7
    Compile log:
    -I/usr/include/c++/4.7 -I/usr/include/c++/4.7/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed -I/usr/include ...

    How to make it work with g++8?

    aha_1980A kshegunovK 3 Replies Last reply
    0
    • K Kofr

      OS Linux mint
      There are gcc versions 4.7 and 8 installed

      $ sudo update-alternatives --config g++
      Есть 2 варианта для альтернативы g++ (предоставляет /usr/bin/g++).
      
        Выбор   Путь          Приор Состояние
      ------------------------------------------------------------
      * 0            /usr/bin/g++-8     800       автоматический режим
        1            /usr/bin/g++-4.7   20        ручной режим
        2            /usr/bin/g++-8     800       ручной режим
      
      Press <enter> to keep the current choice[*], or type selection number: 
      
      

      In QtCreator g++ version of 8 is installed in Kit

      And QtCreator uses GCC 4.7
      Compile log:
      -I/usr/include/c++/4.7 -I/usr/include/c++/4.7/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed -I/usr/include ...

      How to make it work with g++8?

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

      corresponding bug report: https://bugreports.qt.io/browse/QTCREATORBUG-21532

      Qt has to stay free or it will die.

      1 Reply Last reply
      1
      • K Kofr

        OS Linux mint
        There are gcc versions 4.7 and 8 installed

        $ sudo update-alternatives --config g++
        Есть 2 варианта для альтернативы g++ (предоставляет /usr/bin/g++).
        
          Выбор   Путь          Приор Состояние
        ------------------------------------------------------------
        * 0            /usr/bin/g++-8     800       автоматический режим
          1            /usr/bin/g++-4.7   20        ручной режим
          2            /usr/bin/g++-8     800       ручной режим
        
        Press <enter> to keep the current choice[*], or type selection number: 
        
        

        In QtCreator g++ version of 8 is installed in Kit

        And QtCreator uses GCC 4.7
        Compile log:
        -I/usr/include/c++/4.7 -I/usr/include/c++/4.7/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed -I/usr/include ...

        How to make it work with g++8?

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

        @Kofr

        what does ls -l /usr/bin/g++* give?

        also, can you provide a compile log with compiler call?

        Also note that you should give people some time (24 hours) to answer before asking at the second place (bug tracker).

        Thanks!

        Qt has to stay free or it will die.

        K 1 Reply Last reply
        1
        • aha_1980A aha_1980

          @Kofr

          what does ls -l /usr/bin/g++* give?

          also, can you provide a compile log with compiler call?

          Also note that you should give people some time (24 hours) to answer before asking at the second place (bug tracker).

          Thanks!

          K Offline
          K Offline
          Kofr
          wrote on last edited by
          #4

          @aha_1980
          lrwxrwxrwx 1 root root 21 май 24 13:43 /usr/bin/g++ -> /etc/alternatives/g++
          -rwxr-xr-x 1 root root 919832 апр 24 2018 /usr/bin/g++-5
          lrwxrwxrwx 1 root root 22 июн 6 05:26 /usr/bin/g++-8 -> x86_64-linux-gnu-g++-8

          Unfortunately it is impossible to provide logs as I have deleated gcc 4.7 and all its includes manually from
          /usr/include/c++
          and
          /usr/include/x86_64-linux-gnu/c++/

          That solved the problem but not without blood....

          1 Reply Last reply
          0
          • K Kofr

            OS Linux mint
            There are gcc versions 4.7 and 8 installed

            $ sudo update-alternatives --config g++
            Есть 2 варианта для альтернативы g++ (предоставляет /usr/bin/g++).
            
              Выбор   Путь          Приор Состояние
            ------------------------------------------------------------
            * 0            /usr/bin/g++-8     800       автоматический режим
              1            /usr/bin/g++-4.7   20        ручной режим
              2            /usr/bin/g++-8     800       ручной режим
            
            Press <enter> to keep the current choice[*], or type selection number: 
            
            

            In QtCreator g++ version of 8 is installed in Kit

            And QtCreator uses GCC 4.7
            Compile log:
            -I/usr/include/c++/4.7 -I/usr/include/c++/4.7/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed -I/usr/include ...

            How to make it work with g++8?

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by kshegunov
            #5

            The real solution is to provide a separate mkspec file for each of these compilers, the quick (and dirty) solution is to override the compiler in the project file.

            Unfortunately it is impossible to provide logs as I have deleated gcc 4.7 and all its includes manually from

            That's a really, really bad idea.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0

            • Login

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