public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: cygwin@cygwin.com
Subject: Re: GCC doesn't find relative includes when passed paths using backward-slashes
Date: Sun, 15 Jan 2023 17:23:08 +0100	[thread overview]
Message-ID: <87edrv6a37.fsf@Rainer.invalid> (raw)
In-Reply-To: <c593e554-d8ac-a0e5-96c0-c54fe9db633e@grundis.de> (Alexander Grund via Cygwin's message of "Sun, 15 Jan 2023 13:38:31 +0100")

Alexander Grund via Cygwin writes:
> 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. |

Giving any Cygwin tools non-POSIX path constructs is asking for trouble,
notwithstanding the fact that sometimes it works (or seems to work).

> |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.

Then use a build system that doesn't do this.

> | 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.

No it isn't, just like you couldn't expect this to work on Linux.


Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

  parent reply	other threads:[~2023-01-15 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15 12:38 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 [this message]
2023-01-16 23:42 ` Dan Harkless

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edrv6a37.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).