Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Marco Guidi <guidi@fanta.iet.unipi.it>
Subject: Unix Linker understanding
Date: 1998/11/26	[thread overview]
Message-ID: <Pine.BSF.3.91.981126180446.22942A-100000@fanta.iet.unipi.it> (raw)


Iuse a Digital Unix compiler and linker , 
but I think the problem is the same on
all Unix systems

I have the following problem:

I write a very foolish program like the following

void main() {
    int i;
    i++;
}

and save it in a file, e.g. the a.c file.

If I try to compile and link it with

    cc a.c

I get an a.out executable file that I can run.

But if I try to  compile a.c with 
  cc -c a.c

and then I try to link with 
  ld a.o -lc

I get an a.out executable file, but when I run it
I get a Segmentation fault error.

Is there anyone who can help me understanding why this not works ?
(An advice about  documentation will be very good).

My e-mail :
guidi@fanta.iet.unipi.it
guidi@pania.iet.unipi.it
guidi@pegasus.iet.unipi.it

Thanks,
Marco Guidi.






             reply	other threads:[~1998-11-26  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-26  5:00 Marco Guidi [this message]
1998-11-27  5:00 ` Unix Linker understanding Marco Guidi
1998-11-27  5:00 ` Dan Pop
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox