How to change default C++ version for Creator projects
-
Was an idle curiosity, now irritating me that I can't spot answer.
Using Qt 5.15, Qt Creator 6, as supplied for Ubuntu 22.04.
I use qmake. When Creator creates a new project for me the
project.procontainsCONFIG += c++11.Where does that C++ version choice for new projects come from? Googling
qt change default c++ versionhas not showed me where it's stored or how to alter it. Don't know whether Creator might put this in or have a setting (can't see one, tried looking all over) or whether it's some default from qmake?My gcc version is 11.4. I believe I can go to
c++14orc++17fine. I create lots of tiny test projects frequently, I don't want to have to think to change the.proeach time. Preferably a solution which is for end-user, I don't want to alter a system-installed Qt file. -
Was an idle curiosity, now irritating me that I can't spot answer.
Using Qt 5.15, Qt Creator 6, as supplied for Ubuntu 22.04.
I use qmake. When Creator creates a new project for me the
project.procontainsCONFIG += c++11.Where does that C++ version choice for new projects come from? Googling
qt change default c++ versionhas not showed me where it's stored or how to alter it. Don't know whether Creator might put this in or have a setting (can't see one, tried looking all over) or whether it's some default from qmake?My gcc version is 11.4. I believe I can go to
c++14orc++17fine. I create lots of tiny test projects frequently, I don't want to have to think to change the.proeach time. Preferably a solution which is for end-user, I don't want to alter a system-installed Qt file.@JonB You can search for the templates used by QtCreator.
For example I found /usr/share/qtcreator/templates/wizards/projects/consoleapp/file.pro for QtCreator packaged by Ubuntu.
It could also be that QtCreator sets the min C++ version required by the used Qt version to support as many compilers/versions as possible. -
@JonB You can search for the templates used by QtCreator.
For example I found /usr/share/qtcreator/templates/wizards/projects/consoleapp/file.pro for QtCreator packaged by Ubuntu.
It could also be that QtCreator sets the min C++ version required by the used Qt version to support as many compilers/versions as possible.@jsulm said in How to change default C++ version for Creator projects:
For example I found
/usr/share/qtcreator/templates/wizards/projects/consoleapp/file.profor QtCreator packaged by Ubuntu.Will do. I was hoping not to have to alter a system file, for example maybe Creator initially creates something in
~/whateverwhere I could find thec++11, but not having much luck. @J-Hilk suggested~/.config/QtProject ~/.local/share/data/QtProject/qtcreator1, found some files in former, not spotted if that has anything for this issue.It's kind of strange nobody has ever asked this. Wanting to up the default C++ for projects is not unreasonable.
-
@JonB You can search for the templates used by QtCreator.
For example I found /usr/share/qtcreator/templates/wizards/projects/consoleapp/file.pro for QtCreator packaged by Ubuntu.
It could also be that QtCreator sets the min C++ version required by the used Qt version to support as many compilers/versions as possible.@jsulm said in How to change default C++ version for Creator projects:
For example I found
/usr/share/qtcreator/templates/wizards/projects/consoleapp/file.profor QtCreator packaged by Ubuntu.OK, since that's clearly a literal
.profile and it has hard-codedCONFIG += c++11 consolethat is clearly the correct answer! I had thought thec++11would be "generated" from somewhere during project creation, but looks like it was set in whenever Qt was generated/released. Ho hum. Prefer not to alter the system files, will live with having to alter it in generated.profile. At least I know! -
J JonB has marked this topic as solved on
-
J JonB has marked this topic as solved on