Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: lex & yacc questions Keywords: lex, yacc Message-ID: Date: 21 Aug 90 16:24:20 GMT References: <266@cti1.UUCP> <3868@bingvaxu.cc.binghamton.edu> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Distribution: comp Organization: Xenix Support, FICC Lines: 20 Assuming you're using a compiler that uses Ritchie-compiler style switches (say, a UNIX compiler), which is implied by the reference to /lib/libc.a: In article <266@cti1.UUCP> mpledger@cti1.UUCP (Mark Pledger) writes: > When I compile then link using the command line options below, I > always get the "environ" referencing error. The only way I've When you use the "-c" that means "don't link". When you specify the two file names, that means "link". You have confused the compiler. Make is your friend. Build a makefile that looks sort of like this: OFILES= main.o lex.yy.o prog: $(OFILES) $(CC) $(CFLAGS) -o prog $(OFILES) This will compile each program -c to generate a .o file, then link your .o files together. -- Peter da Silva. `-_-' +1 713 274 5180. 'U` peter@ferranti.com