X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 893E03858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1673912596; bh=xjXw+pf0Nve6wponWG7vRYKJJeLaIZBQy8IZ6UrUBrs=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=XKX+5i82CceuHAVrk+7HZlnygypQylfQz7rbELSuTdtB3PElODFsECRW2x4Y4LWHx rKI3IoMcCgbrRAsn1LXqlhIwSV3NH/dolUlBdOpf+Sfp9GvaCTtdlj98uvBCt3Yvow Qtgcag2Gre3PHeugVutvNm9Uv5sYjahvmmJI4Jg8= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C31FB3858C2F X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1673912577; bh=xbxgfRmY4B9Z3vYfn1000amKW6g1iVE3pGq6hrPbddR=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=ovbhI9tDSjd70kv9eXsshU3IcvA76coUS54UuKXuR2Tvi1ksbqMUvT+uVsteFsoUXwArG68+vSP0KPDS+kjiZcxiyJ7keJUbBHagTil+zR3CgGAmGYLDgPDIwnXwtGz5Qv9B/RsJ5iScAVEZtAOYnk/sq9uxq9iRXW63iW2y7YFlH4gPPb/Qimc8oRHiuUq52IfNKn++MoZDBTDCkMso/G1GLw+WkuuXfbqQfehG4ZL63CxY55T9q5IWRo21wvqaSv7PNMBArO/Kg++4bIAFbxDx6JCSh+iE+iM4Trl2N6nuYSFCzHf2OVdC4hqnMUC3lN5kfgophtpz72c1D2IePQ== X-YMail-OSG: XTmOIKcVM1lgLs5vleZjMywwz_qllXNKx0rLsd.UQ.GOpg8ujhtPgtmyTzA9JNU ZX7N987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mPKffXnjLlAsgTS_nAmnysUlspxsSZ6oZ6B3dpls j9Gg4EhA4 X-Sonic-MF: Message-ID: <77fa61cf-0046-3f38-e782-2bb8b4be3fc3@harkless.org> Date: Mon, 16 Jan 2023 15:42:55 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: GCC doesn't find relative includes when passed paths using backward-slashes Content-Language: en-US To: cygwin AT cygwin DOT com References: In-Reply-To: X-Mailer: WebService/1.1.21062 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Dan Harkless via Cygwin Reply-To: Dan Harkless Content-Type: text/plain; charset="utf-8"; Format="flowed" Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 30GNhfn4002758 On 1/15/2023 4:38 AM, Alexander Grund via Cygwin wrote: > 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 || Backslash has a special meaning in C/C++ strings (the quote/escape character).  There's some kind of special magic in Cygwin bash that lets you use most backslashes in paths without escaping them, but ordinarily (outside of '-quotes) on UNIX/Cygwin you need to. If you use:     g++ bar\\main.cpp or:     g++ "bar\\main.cpp" or:     g++ 'bar\main.cpp' it'll work. -- Dan Harkless http://harkless.org/dan/ -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple