一,问题:
在window操作系统下,进行NDK的开发,使用的是cygwin。配置完成后,cygwin提示错误,错误信息如下:
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: /home/Administrator/.bash_profile: line 47: syntax error: unexpected end of file
我安装了cygwin后,进行了如下.bash_profile的配置:
cybwin\home\Administrator\.bash_profile文件的配置:
NDK=/cygdrive/e/android-ndk-r8e-windows-x86 export NDK
二,解决方法:
分析:根据提示“\r”不被识别,而“\r”其实是回车(CR)符号。 可见,虽然都是文本文件,但是,在window下和linux中回车符不相同。
解决:在cygwin中输入:
dos2unix -n .bash_profile .bash_profile
关闭并重新打开cygwin,就正常了。