How to use ld to link C object codes?

How to use ld to link C object codes?

Post by CCYG » Sat, 15 Jan 1994 04:59:02



An easy question for system programmers: how can I use "ld" command to
generate an executable program from some object files.

I know I can use "cc" to do the job and it works fine. But I want to know
what are the necessary options for "ld" to do the job. I have tried the
following command line:

   ld /usr/lib/crt0.o myprogram.o

and the result is not executable.

I am using SunOS. Please help.

Herong Yang

 
 
 

How to use ld to link C object codes?

Post by Part » Tue, 18 Jan 1994 19:00:12



> An easy question for system programmers: how can I use "ld" command

try    man ld

--

EDV-Zentrum, Universitaet fuer Bodenkultur
Nussdorfer Laende 11                      Please correct me, if I am wrong!
A-1190 Wien, Austria (Europe)             Make love, not flame wars.  :-)

 
 
 

How to use ld to link C object codes?

Post by James C. Be » Thu, 20 Jan 1994 00:12:50



Quote:

> An easy question for system programmers: how can I use "ld" command to
> generate an executable program from some object files.

> I know I can use "cc" to do the job and it works fine. But I want to know
> what are the necessary options for "ld" to do the job. I have tried the
> following command line:

>    ld /usr/lib/crt0.o myprogram.o

> and the result is not executable.

> I am using SunOS. Please help.

> Herong Yang

RTFM, buddy.  (hint) try the man page for cc - look at the options list for -dryrun.
Then you figure it out.