Important: Please read the Qt Code of Conduct -

Windows, Qt 5.14.1, mingw and c++17

  • Hi all!

    I installed Qt Creator 4.11.1, with Qt 5.14.1, and the mingw version available is 7.3.0, which, AFAIK, does not support C++17.

    I installed Mingw 9.2.0, and tried to create a new Kit in QtCreator using this version of the compiler, but failed in all attempts.

    Would anyone know a reference on how to create a new QtCreator Kit, using an compiler that does not come with Qt 5.14.1?

    Thanks a lot!

  • Hi, don't think you need to worry about MinGW 9.2.0 for C++17, 7.3 should work fine
    I've been using C++17 features like structured bindings since last year with Qt and MinGW 7.3.

  • Thanks for your help!

    I get a timestamp.h:27:10: error: no member named 'timespec_get' in namespace 'std' and timestamp.h:27:33: error: use of undeclared identifier 'TIME_UTC' in this code: std::timespec_get(&m_value, TIME_UTC);.

    I set QMAKE_CXXFLAGS = -fno-keep-inline-dllexport -std=c++17 -Werror, and also CONFIG += c++17.

    May be I must configure something else?

  • @canellas

    I think you are out of luck, see



    This function is missing on all non-glibc platforms: glibc 2.15, Mac OS X 10.5, FreeBSD 6.4, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0.


  • Ouch! Well, at least I know now that it was not my mistake, and I know now how to fix it: I'll use int clock_gettime(clockid_t clock_id, struct timespec *tp);, as suggested here, and described here

    Thanks a lot!

Log in to reply