最近我测试了用原生代码 C/C++ 编写 Android 应用程序。问题在于使用 Android NDK 时进行符号链接(symbolic link)。经过一番谷歌搜索,有人说要使用 cygwin。我现在已经安装了。请告诉我如何在 Windows 7 中与 cygwin 建立符号链接(symbolic link)。
提前致谢。
最佳答案
简而言之,定义以下环境变量:
CYGWIN=winsymlinks:nativestrict
根据Cygwin documentation :If set to
winsymlinks:native
orwinsymlinks:nativestrict
, Cygwin creates symlinks as native Windows symlinks on filesystems and OS versions supporting them.The difference between
winsymlinks:native
andwinsymlinks: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 withwinsymlinks:native
, while withwinsymlinks:nativestrict
thesymlink(2)
system call will immediately fail.
您还应该确保以提升的权限运行 Cygwin(右键单击快捷方式并选择以管理员身份运行,或设置
mintty
快捷方式属性,高级 → 以管理员身份运行)。the other answer 中提供了一些详细信息.
关于cygwin - 如何在 Windows 7 中使用 cygwin 进行符号链接(symbolic link),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3648819/