GCC doesn't find relative includes when passed paths using backward-slashes

Thomas Wolff towo@towo.net
Sun Jan 15 14:21:39 GMT 2023



Am 15.01.2023 um 14:51 schrieb Hans-Bernhard Bröker via Cygwin:
> Am 15.01.2023 um 13:38 schrieb Alexander Grund via Cygwin:
>
>> The build system, finding it is running on Windows, will pass paths 
>> with backward slashes to the compiler. 
>
> And that's wrong.  Cygwin is not, for practical intents and purposes, 
> Windows.  It just runs on top of it.
>
> Yes, backslashed path names do work in some cases on Cygwin (note that 
> in the case at hand, you did have to "" around the name for that to 
> work).  But at some point that idea has to be given up to achieve the 
> primary goal of emulating a Unix-like environment.
>
> The correct solution thus becomes "Don't do that, then."  Fix the 
> build system detection to recognize Cygwin as a type of Unix, and 
> things will almost certainly just work.
>
>
It also depends on how your application, in this case gcc or rather cpp, 
handles path names.
If it uses library functions dirname and basename, it should work as you 
expect, but maybe it looks for '/' itself, so you cannot expect all 
applications to be patched for cygwin/Windows pathname support.


More information about the Cygwin mailing list