public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* GCC doesn't find relative includes when passed paths using backward-slashes
@ 2023-01-15 12:38 Alexander Grund
  2023-01-15 13:51 ` Hans-Bernhard Bröker
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alexander Grund @ 2023-01-15 12:38 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

Hi,

consider the following MWE:

|$ touch bar/foo.h $ cat bar/main.cpp #include "foo.h" int main(){} With this most simple setup calling GCC with `g++ "bar\main.cpp"` results in GCC failing to find the include file. However using `g++ "bar/main.cpp"` works as expected. |
|So the compiler does find the CPP file and also is able to resolve others paths passed with backslashes (e.g. -I arguments) but basically disables resolving includes relative to the file including it. For context: This turned up on CI for Boost where "|C:\cygwin64\bin" is added to the PATH env variable to be able to use the Cygwin GCC with B2. The build system, finding it is running on Windows, will pass paths with backward slashes to the compiler. This happens on both CMD with the added PATH and using the bash. For reference I tried the same with MinGW and there either path separator worked. So it seems to be an issue in the Cygwin builds of GCC. I tried both 11.2 and 11.3, the latest currently available. Best Regards, Alexander Grund ||

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-16 23:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-15 12:38 GCC doesn't find relative includes when passed paths using backward-slashes Alexander Grund
2023-01-15 13:51 ` Hans-Bernhard Bröker
2023-01-15 14:21   ` Thomas Wolff
2023-01-15 16:23 ` Achim Gratz
2023-01-16 23:42 ` Dan Harkless

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).