https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974
--- Comment #1 from Cristian Adam <cristian.adam at gmail dot com> --- Visual C++ 2022 also suffers from the same problem, see https://developercommunity.visualstudio.com/t/compiler-cant-find-source-file-in-path/10221576 For some reason clang is working fine.