Qt 6.2.2 experimental/filesystem => filesystem
-
I am trying to migrate a Qt 5.15.2 / C++17 project on OpenSUSE Leap 15.3 to Qt 6.2.2.
Obviously one of the changes of Qt 6.2 is expecting the experimental-prefix of std::filesystem to cease. This is why I end up with a "filesystem: No such file or directory" message when qfile.h wants to include the latter.
My installation of OS Leap 15.3 is clean and out of the box.
The Qt 5.15.2 kit works seemlessly, 6.2.2 does not compile.
The desired header is in the "v1" and "9" directory of the /usr/include/c++ tree. It is under "experimental" in the "7" directory of that tree.I am pretty confident that I am just missing something and you'll point me to my omission in no time. Thanks in advance!
-
Thanks all. The problem is: Qt Creator recognizes compilers of different versions (7 and 9). When configuring the kits, however, it always refers to
/usr/bin/g++
. There is a combobox where one could theoretically select a compiler, but it is disabled in my case. I do need both versions as I have to keep 5.15.2 as a compile option. Changing the symlink to the version I need (update-alternatives
) is a workaround as it disables compiling against the other Qt version. Would be a blast to be able to select the compiler version directly and use/usr/bin/g++-9
instead of/usr/bin/g++
. -
According to the supported platforms page you need at least gcc 9.
-
@Christian-Ehrlicher I know....GCC9 is installed. Somehow qmake still does not find it.
-
@AxelVienna said in Qt 6.2.2 experimental/filesystem => filesystem:
/usr/include/c++
if you still have experimental-prefix of std::filesystem, gcc/g++ version is not right.
check the version of g++: g++ --versionGCC 8
Runtime Library (libstdc++)
Improved experimental support for C++17, including the following features:
Deduction guides to support class template argument deduction.
std::filesystem implementation.
std::char_traits<char> and std::char_traits<wchar_t> are usable in constant expressions.
std::to_chars and std::from_chars (for integers only, not for floating point types).you may purge gcc/g++ 7 from your computer and reinstall gcc/g++ 9
-
Either uninstall gcc 7 or set the CC and CXX environment variables appropriately.
-
If you want to keep the older gcc versions for some reason, you can update which version /usr/bin/g++ points to with 'update-alternatives'. This page is for Ubuntu, but I think it works OpenSuse as well (Steps 2-4), https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa
-
Thanks all. The problem is: Qt Creator recognizes compilers of different versions (7 and 9). When configuring the kits, however, it always refers to
/usr/bin/g++
. There is a combobox where one could theoretically select a compiler, but it is disabled in my case. I do need both versions as I have to keep 5.15.2 as a compile option. Changing the symlink to the version I need (update-alternatives
) is a workaround as it disables compiling against the other Qt version. Would be a blast to be able to select the compiler version directly and use/usr/bin/g++-9
instead of/usr/bin/g++
. -
@AxelVienna Can you show your Compilers tab? You can add compilers there, then you should be able to select needed compiler in a Kit.
-
This is the compilers tab
... and this is the kit, where the compiler selection is disabled.
(Pressing the "manage" button next to the compiler seleciton opens the compiler tab)
-
@AxelVienna said in Qt 6.2.2 experimental/filesystem => filesystem:
where the compiler selection is disabled
You can create a new Kit and configure it with same Qt version but another compiler.
-
Ah, the cloning did the trick. Was unaware of this, thanks for the hint.
While I use qmake from the Qt 6.2.2 tree, I still have to addQMAKE_CXX=g++-9
as an additional argument to the qmake build step. Then it works :-)