c++qt

Adding different compiler to QT


How can I add another compiler and use it with QT?
I'm asking because I couldn't find it anywhere on the web how to do it.


Solution

  • If you are using qmake, you can override the compiler used by the current mkspec with QMAKE_CXX, e.g. qmake QMAKE_CXX=g++-4.6.

    To permanently override it, you'll need a new or edit the mkspec files. You can browse where they are with qmake -query and look at the QMAKE_MKSPECS variable. From there, the directory "default" is used if you do not use the -spec parameter in qmake. In that directory, the file qmake.conf will contain the mentioned QMAKE_CXX paramater that determines the compiler.