Ld o eatsyscall eatsyscallo

Specifies the name k^ of the object code file to be linked.

Specifies the name of the executable file that will be generated.

Figure 5-12: The anatomy of an ld command line

Note that if you do not specify an executable filename with the -o command, ld will create a file with the default name a.out. If you ever see a mysterious file named a.out in one of your project directories, it probably means you ran the linker without the -o command.

The last things you enter on the ld command line are the names of the object files to be linked. In this case there is only one, but once you begin using code libraries (whether your own or those written by others) you'll have to enter the names of any libraries you're using on the command line. The order in which you enter them doesn't matter. Just make sure that they're all there.

Figure 5-12: The anatomy of an ld command line

Was this article helpful?

0 0

Post a comment