From: "Troelz Denver" Newsgroups: comp.os.msdos.djgpp Subject: Troubles linking into a library Date: Wed, 25 Aug 1999 10:37:47 +0200 Organization: UNI-C Lines: 31 Message-ID: <7q0a36$10c0$1@news.net.uni-c.dk> NNTP-Posting-Host: pc97.iau.dtu.dk X-Trace: news.net.uni-c.dk 935570342 33152 192.38.66.197 (25 Aug 1999 08:39:02 GMT) X-Complaints-To: usenet AT news DOT net DOT uni-c DOT dk NNTP-Posting-Date: 25 Aug 1999 08:39:02 GMT X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi guys, I'm trying to link a set of files into a library. I am using the ar command as follows: ar -crus fileout.a file1 file2 file3 This correctly gives the file fileout.a When I later link to this file: gcc file.c fileout.a in order to make an executable, I get the respond libout.a: could not read symbols: Archive has no index; run ranlib to add one The I use ranlib to add an index (-s on ar should have inserted the index): ranlib fileout.a When running gcc again I get the same answer as before. What am I doing wrong? Both ranlib and ar are version 2.8.1. BR's Troelz