配置NDK syntax error: unexpected end of file 解决

android NDK开发中,在window环境下需要安装cygwin来模拟linux环境,在网上配置文章较多,不详述,在配置的过程中,需要修改cybwin\home\XXX(you computer name)目录下的.bash_profile中末尾添加

ANDROID_NDK_ROOT=/cygdrive/d/andorid/NDK/android-ndk-r7b  
export ANDROID_NDK_ROOT

ANDROID_NDK_ROOT(可以随意命名)。在使用UltraEdit打开.bash_profile文件的时候,点了转化为DOS format。


在启动cygwin,会显示

-bash:$'\r':commandnotfound
-bash:$'\r':commandnotfound
-bash:$'\r':commandnotfound
-bash:$'\r':commandnotfound
-bash:$'\r':commandnotfound
-bash:$'\r':commandnotfound
-bash:$'\r':commandnotfound
-bash:/home/lenovo/.bash_profile:line47:syntaxerror:unexpectedendoffile

错误。一开始没有找到好的方法,后来在: http://glitterhsin.pixnet.net/blog/post/88049087-%E5%8D%A1%E9%97%9C%EF%BC%8C%E5%8D%83%E8%90%AC%E4%B8%8D%E8%A6%81%E7%94%A8wordpad%E7%B7%A8%E8%BC%AF.bash_profile中找到解决办法,非常简单(这个网页好像要才能看到)。

在cygwin中输入:dos2unix -n .bash_profile .bash_profile

关闭重新打开cygwin,ok了。所以再一次提醒,不要用window里的记事本或者写字本打开修改,使用UltraEdit不要转化格式,因为在window下和linux中回车符是不相同的。





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值