Skip to content
Advertisement

ld cannot recognize the options

I’am reading this Tuto, and I’am trying to link the application using this command: ld test.o –o test.bin, the linker doesn’t recognize the -o option :

JavaScript

Using ld -help the option -o exist but i don’t understand why I’am getting this problem.

This is the linker version.

JavaScript

Advertisement

Answer

My good eyes and my bitter experience tell me that you must have copied/pasted some text coming from MS-Office where the dash (-) has been converted to another dash which is unicode or whatever. Notice the length of the dash character in your text.

Actually, the tuto you were refering to is the one at fault, ex in this line:

JavaScript

Note the 2 infamous “long-dashes” that cannot work on a command line.

Your command as-is, followed by the retyped command. notice something?

JavaScript

Since the dash is not the correct one, ld assumes that this is an object file and tries to open it, hence the error.

Advertisement