Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!lll-winken!uunet!cme!cam!crosson From: crosson@cam.nist.gov (Bob_Crosson_x3832) Newsgroups: comp.unix.sysv386 Subject: 'ld' problem in Interactive UNIX 2.2 Keywords: interactive unix ld Message-ID: <8625@sunbow.cam.nist.gov> Date: 14 May 91 19:07:01 GMT Distribution: usa Organization: National Institute of Standards & Technology, Gaithersburg, MD Lines: 50 I am running Interactive's UNIX 2.2. I am trying to compile a C program using make and keep getting an error from 'ld'. Below are a file called 'hello.c', a make file for hello.c, and the results when make processes the make file. Can anyone tell me why ld cannot find 'environ'? I have used 'ar' to dump all of the library element names from the files /lib/lib*.a and /usr/lib/lib*.a and cannot find environ. I am running the C-shell. Could that have anything to do with it? Just 'cc hello.c' produces an a.out that executes correctly. Thanks in advance for any help. My e-mail address is crosson@cam.nist.gov -------------------------------------------------------------- This is the hello.c file: #include main() { fprintf( stdout, "Hello to you, world\n"); } -------------------------------------------------------------- # makefile for 'hello.c' CC = /bin/cc CFLAGS = -O LD = /bin/ld LIBDIR = /lib LLIBDIR = /usr/lib LIBS = -Y L,$(LIBDIR) -Y U,$(LLIBDIR) LDFLAGS = -lc .c.o : $(CC) $(CFLAGS) -c $< hello : hello.o $(LD) $(LIBS) -o hello hello.o $(LDFLAGS) -------------------------------------------------------------- Output from running the make file: /bin/cc -O -c hello.c /bin/ld -Y L,/lib -Y U,/usr/lib -o hello hello.o -lc undefined first referenced symbol in file environ /lib/libc.a ld fatal: Symbol referencing errors. No output written to hello *** Error code 13