Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!ccncsu!purdue!mentor.cc.purdue.edu!noose.ecn.purdue.edu!samsung!balrog!ctron.com From: dj@ctron.com (DJ Delorie) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: HELP, ar on dj's gcc release is not working for me Message-ID: <1447@balrog.ctron.com> Date: 25 Apr 91 15:48:23 GMT References: <1991Apr25.151211.6777@magnus.acs.ohio-state.edu> Sender: news@balrog.ctron.com Reply-To: dj@ctron.com Organization: None whatsoever Lines: 37 In article <1991Apr25.151211.6777@magnus.acs.ohio-state.edu>, bjones@magnus.acs.ohio-state.edu (William A Jones) writes: > When I attempt to create an archive file, I am typing > > ar -r libxxx.a file1 file2 ... fileN > > and I am getting the message that the archive has been created. Then > when I try to do anything else with the archive file, such as try to add > an additional file, print a table of contents, or access it in any way, I > get the message > > file1.o > ar: file libxxx.a not a valid archive > > Does anyone have any suggestions about what I am doing wrong or forgetting to > do?? I'm beginning to get desparate since the program I am debugging uses > (at last count) 24 modules which have already been debugged and I am tired > of wading through the command line link and of writing makefiles for it. There appears to be a bug (?) in ar whereby once an archive is sequenced, you can't do anything with it (except link with it), but you have to sequence the archive to link against it. The method I suggested in the documentation (at least I think I documented it) is: stuff.a : $(OBJS) ar r stuff1.a $(OBJS) copy stuff1.a stuff.a ar rs libstuff.a Others claim that there is no such bug, by the above method is the one I use to create the libraries I distribute, because *I* always get that bug. DJ dj@ctron.com