How to make a symbolic link with Cygwin in Windows 7

Viewed 47067

Recently I have tested to write an Android application with native code in C/C++. The problem is in making symbolic links when using the Android NDK. After some googling, some say to use Cygwin. I have installed it now. How can I make a symbolic link with Cygwin in Windows 7?

4 Answers

We had a similar problem and had a solution not documented in previous answers.

We needed a way to create a directory remote link that worked for both Cygwin and Windows 7 to a remote Samba (Linux) share.

We used this command in Windows PowerShell and it worked.

CMD /C MKLINK /D C:\local_dir_path\dir \\\\192.168.0.1\remote_dir_path\dir

The above command makes a link that works in both.

Of course, please change the local and remote directories to meet your needs.

ln -s works in Cygwin, but not Windows.

Using a "make link" command in Windows Explorer (folder view) worked in Windows, but not in Cygwin.

A similar command as above entered in Cygwin did not work and we didn't completely understand why. Perhaps it is related to conversion of strings or paths.

Related