On 7/22/21 10:00 AM, Yeting Kuo via Gcc-help wrote:
Hi all, I found that gcc 10.2.0 does not consider the source directory as include path, when we use windows format like "C:\\tests\\x.c". I run it correctly with gcc 5.4.0. I also have correct result with format "C://tests//x.c" and "/cygdrive/c/tests/x.c" in gcc 10.2.0. experiment: $ ls "C:\\tests" test.h x.c $ gcc -E "C:\\tests\\x.c" -o /dev/null C:\tests\x.c:1:10: fatal error: test.h: No such file or directory 1 | #include "test.h" | ^~~~~~~~ compilation terminated.
Don't do that, Windows paths are not supported for Cygwin. You may argue "it used to work" or "it works sometimes" but it doesn't change the fact that it is not supported and will never be.
A blackslash is a valid character for filenames in the environment Cygwin is attempting to emulate, no attempts will be made to introduce extra logic in gcc for a feature that isn't supported on Cygwin.
If you need to use gcc with windows paths, use the mingw hosted gcc built natively for Windows.