How to make symbolic link with cygwin in Windows 7

后端 未结 3 428
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 01:06

Recently I have tested to write Android application with native code C/C++. The problem is in making symbolic link when using Android NDK. After some Googling, some say to u

相关标签:
3条回答
  • 2020-11-30 01:49

    You may try to use "mklink" insteed of "ln -s" as @Tony O'Hagan suggested here: Git Bash Shell fails to create symbolic links

    0 讨论(0)
  • 2020-11-30 01:50

    In short, define the following environment variable:

    CYGWIN=winsymlinks:nativestrict
    

    According to Cygwin documentation:

    If set to winsymlinks:native or winsymlinks:nativestrict, Cygwin creates symlinks as native Windows symlinks on filesystems and OS versions supporting them.

    The difference between winsymlinks:native and winsymlinks:nativestrict is this: If the filesystem supports native symlinks and Cygwin fails to create a native symlink for some reason, it will fall back to creating Cygwin default symlinks with winsymlinks:native, while with winsymlinks:nativestrict the symlink(2) system call will immediately fail.

    You should also make sure you run Cygwin with elevated privileges (right-click the shortcut and choose Run as Administrator, or set the mintty shortcut property, Advanced → Run as Administrator).

    Some details are provided in the other answer.

    0 讨论(0)
  • 2020-11-30 01:51

    I got it next day! So, not to wrongly get ignorance thinking like me (newbie to cygwin), I answer it now. Making a symbolic link for Windows 7 is easy with the usual command ln -s…. The answer is setting up cygwin with required packages such as make, etc.

    Read the requirements clearly: https://developer.android.com/sdk/ndk/index.html

    0 讨论(0)
提交回复
热议问题