Date: Fri, 28 Nov 1997 09:11:05 -0800 (PST) Message-Id: <199711281711.JAA10696@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Jay Qiu , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: GNU binutils 2.8.1: ar.exe Cc: qiuji AT cig DOT mot DOT com Precedence: bulk At 02:22 11/21/1997 -0600, Jay Qiu wrote: >Hi, there, > >I recently got a copy of 'ar.exe' from djgpp web page. Unfortunately, >after I installed the "ar.exe" to my path (h:\bin) and run the 'ar' >command as "R:\cp>ar -rc cp.a main.o", it always give error message as > > h:\bin\ar.exe: cp.a: No such file or directory (ENOENT) That makes sense. The `r' option says that you want to add to an existing library, replacing any modules that are already there. Since `cp.a' does not exist yet, you can't add to it. What you probably want to do is this: ar -qc cp.a main.o The `q' means that it should append instead of replacing, and the `c' means to create the library if necessary. > >And it is strange that if I do "ar -?", it will return me with > > h:/bin/ar.exe: illegal option -- ? > Usage: h:/bin/ar.exe [-]{dmpqrtx}[abcilosuvV] [member-name] > archive-file file... > h:/bin/ar.exe -M [ h:/bin/ar.exe: supported targets: coff-go32 coff-go32-exe a.out-i386 > srec symbolsrec tekhex binary ihex > >notice that the Usage is "h:/bin/ar.exe", rather than just "ar" (?). First, `-?' is not usually the way to get help for GNU utils. Usually it will be either `--help' or `-h'. And the `h:/bin/ar.exe' stems from the Unix tradition of putting the program's name in the help. Since it doesn't know what the user might have renamed it to, it uses the contents of `argv[0]'. On Unix, this is just its name (`ar'), but on DOS it includes the full path and filename for (I think) compatibility with DOS. You can ignore the path, etc. >I compiled the C/C++ code from the command line (NT's DOS window) with >the Borland C++ compiler (v5.0) to generate the object files, and then >used the 'ar' utility to create a library archive file from those object >files. That's another problem. Borland's compiler uses a different and incompatible object file format. DJGPP's `ar' is only intended to work with COFF object files produced by GCC. You'll have to use one of Borland's tools to make libraries of Borland code. Nate Eldredge eldredge AT ap DOT net