public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Workaround for cygwin's way of linking folders?
@ 2020-12-06 22:41 Johnathan Schneider
  2020-12-06 23:45 ` Ken Brown
  2020-12-07  7:27 ` L A Walsh
  0 siblings, 2 replies; 4+ messages in thread
From: Johnathan Schneider @ 2020-12-06 22:41 UTC (permalink / raw)
  To: cygwin

Hi all,

I'm setting up a cross platform development environment using Cygwin. Upon attempting to use Cygwin's CMake that is natively bundled, I discovered that Cygwin goes looking for the gcc in /usr/bin/cc, a folder that does not exist according to windows. I have familiarized myself with the Cygwin way of organizing it's folders, seen here https://cygwin.com/faq.html#faq.using.shortcuts and https://cygwin.com/faq.html#faq.using.directory-structure and thus I know that Cygwin's /usr/bin folder is in fact /bin - according to windows, anyways. However, I'm not familiar with how to work around that on windows. In particular, virtually all of my IDEs' attempts to call CMake fail, because I proceed to ask it to call the gcc and windows, as is explained in the above FAQ's, does not recognize the Cygwin-way of referencing folders.

Alas, my question - what is the recommended workaround?

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

* Re: Workaround for cygwin's way of linking folders?
  2020-12-06 22:41 Workaround for cygwin's way of linking folders? Johnathan Schneider
@ 2020-12-06 23:45 ` Ken Brown
  2020-12-07  1:39   ` Eliot Moss
  2020-12-07  7:27 ` L A Walsh
  1 sibling, 1 reply; 4+ messages in thread
From: Ken Brown @ 2020-12-06 23:45 UTC (permalink / raw)
  To: Johnathan Schneider, cygwin

On 12/6/2020 5:41 PM, Johnathan Schneider via Cygwin wrote:
> Hi all,
> 
> I'm setting up a cross platform development environment using Cygwin. Upon attempting to use Cygwin's CMake that is natively bundled, I discovered that Cygwin goes looking for the gcc in /usr/bin/cc, a folder that does not exist according to windows. I have familiarized myself with the Cygwin way of organizing it's folders, seen here https://cygwin.com/faq.html#faq.using.shortcuts and https://cygwin.com/faq.html#faq.using.directory-structure and thus I know that Cygwin's /usr/bin folder is in fact /bin - according to windows, anyways. However, I'm not familiar with how to work around that on windows. In particular, virtually all of my IDEs' attempts to call CMake fail, because I proceed to ask it to call the gcc and windows, as is explained in the above FAQ's, does not recognize the Cygwin-way of referencing folders.
> 
> Alas, my question - what is the recommended workaround?

It's hard to answer this question without knowing exactly what your IDE is 
doing.  Can you give a detailed recipe for reproducing the problem without using 
an IDE?  In general, Cygwin's CMake should have no problem executing /usr/bin/cc 
unless something is interfering with Cygwin's normal path handling routines.

Ken

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

* Re: Workaround for cygwin's way of linking folders?
  2020-12-06 23:45 ` Ken Brown
@ 2020-12-07  1:39   ` Eliot Moss
  0 siblings, 0 replies; 4+ messages in thread
From: Eliot Moss @ 2020-12-07  1:39 UTC (permalink / raw)
  To: Ken Brown, Johnathan Schneider, cygwin

On 12/6/2020 6:45 PM, Ken Brown via Cygwin wrote:
> On 12/6/2020 5:41 PM, Johnathan Schneider via Cygwin wrote:
>> Hi all,
>>
>> I'm setting up a cross platform development environment using Cygwin. Upon attempting to use 
>> Cygwin's CMake that is natively bundled, I discovered that Cygwin goes looking for the gcc in 
>> /usr/bin/cc, a folder that does not exist according to windows. I have familiarized myself with 
>> the Cygwin way of organizing it's folders, seen here 
>> https://cygwin.com/faq.html#faq.using.shortcuts and 
>> https://cygwin.com/faq.html#faq.using.directory-structure and thus I know that Cygwin's /usr/bin 
>> folder is in fact /bin - according to windows, anyways. However, I'm not familiar with how to work 
>> around that on windows. In particular, virtually all of my IDEs' attempts to call CMake fail, 
>> because I proceed to ask it to call the gcc and windows, as is explained in the above FAQ's, does 
>> not recognize the Cygwin-way of referencing folders.
>>
>> Alas, my question - what is the recommended workaround?
> 
> It's hard to answer this question without knowing exactly what your IDE is doing.  Can you give a 
> detailed recipe for reproducing the problem without using an IDE?  In general, Cygwin's CMake should 
> have no problem executing /usr/bin/cc unless something is interfering with Cygwin's normal path 
> handling routines.

My guess: Your IDE is Windows based, and it is unlikely to play well with Cygwin.  It probably 
expects Windows paths, etc.  MinGW might gives Unix-like tools that work better for you, or you can 
find Windows based CMake, C compilers, etc.

With some effort, you _might_ get the IDEA to invoke the Cygwin program by giving the full Windows 
path to it, but /usr/bin/cc is going to expect Cygwin format paths, which a Windows based IDE won't 
know anything about ...

My guess could be wrong, of course!

Regards - Eliot Moss

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

* Re: Workaround for cygwin's way of linking folders?
  2020-12-06 22:41 Workaround for cygwin's way of linking folders? Johnathan Schneider
  2020-12-06 23:45 ` Ken Brown
@ 2020-12-07  7:27 ` L A Walsh
  1 sibling, 0 replies; 4+ messages in thread
From: L A Walsh @ 2020-12-07  7:27 UTC (permalink / raw)
  To: Johnathan Schneider; +Cc: cygwin

On 2020/12/06 14:41, Johnathan Schneider via Cygwin wrote:
> Hi all,
>
> I'm setting up a cross platform development environment using Cygwin. Upon attempting to use Cygwin's CMake that is natively bundled, I discovered that Cygwin goes looking for the gcc in /usr/bin/cc,
----
    If you go into 'bash' under cygwin, what do you see in /usr/bin?
/usr/bin is only a valid path inside programs that are running on cygwin --
if you run programs outside of cygwin, say directly from Windows, they 
won't see
them.

    Cmake would likely be in the same folder as gcc.  How are you invoking
Cmake?  If you are running cmake from, say, the cygwin path of /bin 
(assuming
you have cygwin installed at C:\ and have your cygwin mount prefix set 
to '/'.
In bash, type mount -p and you should see something like:
>  mount -p

Prefix              Type         Flags                                          
/                   user         binmode                                        


Just like windows has various magic folders that show up under explorer, but
don't really exist, cygwin does too, but only cygwin utils see the
cygwin-folders.

    FWIW, /bin from a cygwin install is mounted (within cygwin) on 
/usr/bin, so
the contents should be the same.

    If you want to make use of windows+cygwin at the same time, it's best
to install cygwin at 'C:\' and set you mount prefix like I have above, then
you will get more commonality between windows+cygwin.  For example, to make
/usr/bin appear under window, I have a symlink at C:/usr/bin that points to
C:/bin.

Under windows, a 'dir' of C:\usr will show (from cmd.exe, some lines removed
for brevity):
C:\Users\linda>dir \usr
 Volume in drive C is System Disk

 Directory of C:\usr

2020/05/17  17:11    <DIR>          .
2020/05/17  17:11    <DIR>          ..
2018/05/19  09:42    <SYMLINKD>     bin [..\bin]
2020/10/07  09:35    <DIR>          include
2018/05/19  09:41    <SYMLINKD>     lib [..\lib]
2018/05/17  11:20    <SYMLINKD>     lib64 [..\lib]
2020/12/06  23:25    <SYMLINKD>     sbin [..\sbin]
2020/11/03  20:38    <DIR>          share
2020/10/07  08:37    <DIR>          src
2020/05/17  17:11    <DIR>          x86_64-pc-cygwin
               0 File(s)              0 bytes
              17 Dir(s)  150,639,538,176 bytes free

>  
> Alas, my question - what is the recommended workaround?
>   
---
    Look for cygwin paths from a cygwin shell.  That's the start.
Making win+cyg play nice, involves little bits like symlinks
like I used above.  It's not officially supported by the cygwin, but
I find such things convenient.



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

end of thread, other threads:[~2020-12-07  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06 22:41 Workaround for cygwin's way of linking folders? Johnathan Schneider
2020-12-06 23:45 ` Ken Brown
2020-12-07  1:39   ` Eliot Moss
2020-12-07  7:27 ` L A Walsh

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