Linux ld无法识别这些选项
我正在阅读此内容,并尝试使用以下命令链接应用程序:Linux ld无法识别这些选项,linux,gcc,linker,ld,Linux,Gcc,Linker,Ld,我正在阅读此内容,并尝试使用以下命令链接应用程序:ld test.o–o test.bin,链接器无法识别-o选项: ld: cannot find –o: No such file or directory 使用ld-help选项-o存在,但我不明白为什么会出现这个问题 这是链接器版本 $ ld -version GNU ld (GNU Binutils for Ubuntu) 2.24 Copyright 2013 Free Software Foundation, Inc. This p
ld test.o–o test.bin
,链接器无法识别-o
选项:
ld: cannot find –o: No such file or directory
使用ld-help
选项-o
存在,但我不明白为什么会出现这个问题
这是链接器版本
$ ld -version
GNU ld (GNU Binutils for Ubuntu) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
我的好眼睛和痛苦的经历告诉我,你一定复制/粘贴了一些来自MS Office的文本,其中破折号(
-
)已转换为另一个unicode破折号或其他破折号。请注意文本中短划线字符的长度
事实上,你提到的那首图图是错的,比如这一行:
ld –Ttext 0x7c00 --oformat=binary test.o –o test.bin
请注意,两条臭名昭著的“长破折号”无法在命令行上工作
您的命令保持原样,然后是重新键入的命令。注意到什么了吗
ld test.o –o test.bin # long dash, fails
ld test.o -o test.bin # good one, short dash
由于破折号不正确,
ld
假定这是一个目标文件,并试图打开它,因此出现了错误。很好,它解决了我的问题,非常感谢