QFileInfo in Qt6.3 MinGW broken?
-
Hi, I'm having a problem when including QFileInfo in my project using Qt 6.3 on MinGW on my CI
[ 15%] Building CXX object examples/exam_ModelSerialisation/CMakeFiles/exam_ModelSerialisation.dir/exam_modelserialisation.cpp.obj In file included from C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/filesystem:37, from D:/a/QtModelUtilities/Qt/6.3.0/mingw_64/include/QtCore/qfile.h:49, from D:/a/QtModelUtilities/Qt/6.3.0/mingw_64/include/QtCore/qfileinfo.h:43, from D:/a/QtModelUtilities/Qt/6.3.0/mingw_64/include/QtCore/QFileInfo:1, from D:\a\QtModelUtilities\QtModelUtilities\examples\exam_ModelSerialisation\exam_modelserialisation.cpp:10: C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/fs_path.h: In member function 'std::filesystem::__cxx11::path& std::filesystem::__cxx11::path::operator/=(const std::filesystem::__cxx11::path&)': C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/fs_path.h:237:47: error: no match for 'operator!=' (operand types are 'std::filesystem::__cxx11::path' and 'std::filesystem::__cxx11::path') || (__p.has_root_name() && __p.root_name() != root_name())) ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ In file included from C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/utility:70, from D:/a/QtModelUtilities/Qt/6.3.0/mingw_64/include/QtCore/qglobal.h:47, from D:/a/QtModelUtilities/Qt/6.3.0/mingw_64/include/QtGui/qtguiglobal.h:43, from D:/a/QtModelUtilities/Qt/6.3.0/mingw_64/include/QtWidgets/qtwidgetsglobal.h:43, from D:/a/QtModelUtilities/Qt/6.3.0/mingw_64/include/QtWidgets/qapplication.h:43, from D:/a/QtModelUtilities/Qt/6.3.0/mingw_64/include/QtWidgets/QApplication:1, from D:\a\QtModelUtilities\QtModelUtilities\examples\exam_ModelSerialisation\exam_modelserialisation.cpp:1: C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_pair.h:456:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)' operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) ^~~~~~~~ C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_pair.h:456:5: note: template argument deduction/substitution failed
(full output available here: https://github.com/VSRonin/QtModelUtilities/runs/6321094127?check_suite_focus=true)
exam_modelserialisation.cpp:10
is a line with#include <QFileInfo>
All other platforms/versions work so wanted to know if it's a problem with my CI or with the MinGW version of Qt 6.3
-
MinGW 8.1 is a bit dated. See https://wiki.qt.io/MinGW for which version of MinGW Qt has been built with.
Please upgrade your MinGW version on your CI.
-
C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/fs_path.h:237:47: error: no match for 'operator!=' (operand types are 'std::filesystem::__cxx11::path' and 'std::filesystem::__cxx11::path') || (__p.has_root_name() && __p.root_name() != root_name()))`
The real problem is here. It cannot find an operator!= for std::filesystem::path.
For some reason it has __cxx11 in the path? I'm not sure what that but if it's related to c++ std version used then you need to update it, Qt 6 requires C++17.
-
MinGW 8.1 is a bit dated. See https://wiki.qt.io/MinGW for which version of MinGW Qt has been built with.
Please upgrade your MinGW version on your CI.