From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,7869b04c4f1440fd,start X-Google-Attributes: gid1164f8,public From: Marco Guidi Subject: Unix Linker understanding Date: 1998/11/26 Message-ID: #1/1 X-Deja-AN: 415948565 Organization: Universita' di Pisa Content-Type: TEXT/PLAIN; charset=US-ASCII Mime-Version: 1.0 Newsgroups: comp.sys.dec 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.