hello.s:15: 错误: junk at end of line, first unrecognized character valued 0x8 的解决方法

gcc编译报错如下:
hello.s: 警告: 文件结束,非行尾;插入新行
hello.s:1: 错误: junk at end of line, first unrecognized character valued 0x7f
hello.s:1: 错误: junk at end of line, first unrecognized character valued 0x3
hello.s:1: 错误: junk at end of line, first unrecognized character is >' hello.s:1: 错误: junk at end of line, first unrecognized character valued 0x1 hello.s:1: 错误: junk at end of line, first unrecognized character is0’
hello.s:1: 错误: junk at end of line, first unrecognized character is @' hello.s:1: 错误: junk at end of line, first unrecognized character is(’
hello.s:1: 错误: junk at end of line, first unrecognized character is @' hello.s:1: 错误: junk at end of line, first unrecognized character is8’
hello.s:1: 错误: junk at end of line, first unrecognized character is @' hello.s:1: 错误: junk at end of line, first unrecognized character valued 0x1b hello.s:1: 错误: junk at end of line, first unrecognized character valued 0x1a hello.s:1: 错误: junk at end of line, first unrecognized character valued 0x6 hello.s:1: 错误: junk at end of line, first unrecognized character valued 0x4 hello.s:1: 错误: junk at end of line, first unrecognized character is@’
全网也没什么对的解决方法,仔细研究了下。gcc编译器没问题,问题在于gcc代码输入时大小写打错了!!!
正确命令如下

gcc -E hello.c -o hello.i -v
gcc -S hello.i -o hello.s -v
gcc -c hello.s -o hello.o -v

生成.s文件时 gcc -S 的s要大写
否则后面 gcc -c 生成.o文件时 就会出错!!

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值