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



  • 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?


  • Qt Champions 2017


  • Qt Champions 2017

    @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!



  • @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....


  • Qt Champions 2017

    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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.