I am trying to use C++20 with Qt, but no matter what I do, it always defaults to C++17.
Here is the relevant part of the output after configuration:
# head config.summaryBuild type: linux-g++ (x86_64, CPU features: mmx sse sse2)Compiler: gcc 13.1.0Configuration: sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_new_dtags f16c largefile precompile_header rdrnd rdseed shani x86SimdAlways shared shared rpath release c++11 c++14 c++17 c++1z concurrent dbus reduce_exports reduce_relocations stlBuild options: Using C standard ....................... C11 Using C++ standard ..................... C++17
Dockerfile. I am running the following in a Docker container:
FROM ubuntu:18.04# Install gcc-13 PPARUN echo "deb [trusted=yes] http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic main" > /etc/apt/sources.list.d/ubuntu-toolchain-r-test.list && \ apt update && \ apt install -y --no-install-recommends gcc-13 g++-13 && \ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 && \ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100WORKDIR /opt/buildRUN sed -i 's|# deb|deb|' /etc/apt/sources.list && \ apt update && \ apt install -y --no-install-recommends git libedit-dev libopenal-data libsndio-dev libopenal1 libopenal-dev pulseaudio libpthread-workqueue-dev && \ apt build-dep -y qtbase-opensource-src && \ apt-get purge -y gcc-7 g++-7 cpp-7 gcc-7-base && \ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 && \ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100 && \ apt install -y wget xz-utils && \ wget -P /opt/ https://cdimage.debian.org/mirror/qt.io/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz && \ tar -xf /opt/qt-everywhere-opensource-src-5.15.16.tar.xz -C /opt/
Build Steps. After starting the container, I run the following commands:
docker run -it --rm IAMGENAME bashexport CXXFLAGS="-std=c++20"../qt-everywhere-src-5.15.16/configure -bundled-xcb-xinput -xcb -xcb-xlib -pulseaudio -alsa -opensource -confirm-license -recheck-all -v -nomake tests -nomake examples
However, the configuration always defaults to C++17, as shown in the config.summary file.
How can I configure to use the C++20 standard?
Any help would be greatly appreciated!