Bug 1859 – The librarian (lib.exe) confused by dashes in object names

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-02-21T14:09:00Z
Last change time
2015-06-09T01:31:15Z
Assigned to
bugzilla
Creator
torhu

Comments

Comment #0 by torhu — 2008-02-21T14:09:29Z
I'm not sure if this is the correct place for reporting this, but it's I across it because of rebuild's use of dashes in object file names. Doing the following will cause lib to go into interactive mode instead of adding b-c.obj to the library: --- c:\prog\test\lib>lib -c test.lib a.obj Digital Mars Librarian Version 8.02n Copyright (C) Digital Mars 2000-2007 All Rights Reserved http://www.digitalmars.com/ctg/lib.html Digital Mars Librarian complete. c:\prog\test\lib>lib test.lib b-c.obj Digital Mars Librarian Version 8.02n Copyright (C) Digital Mars 2000-2007 All Rights Reserved http://www.digitalmars.com/ctg/lib.html list file (.lst) c:\prog\test\lib>oops... --- Adding an option, like -p512 when adding b-c.obj fixes the problem. Putting quotes around the file name doesn't help.
Comment #1 by bugzilla — 2008-02-22T05:04:47Z
This is how lib is designed to work. See http://www.digitalmars.com/ctg/lib.html Always put the switches first, or you'll be using the "obsolete" syntax.
Comment #2 by torhu — 2008-02-22T05:09:04Z
The problem is that this: lib test.lib b-c.obj When there are no switches, the docs say that the object files will be added to the library. But object file names with dashes in them confuse lib, so with the above command line, it enters interactive mode instead.
Comment #3 by bugzilla — 2008-02-22T14:05:29Z
That's because it matches the syntax used by the obsolete syntax. There's nothing to be done about that, except don't put - in your object files. Use an _ instead.
Comment #4 by matti.niemenmaa+dbugzilla — 2008-02-22T15:28:09Z
How about an option ("--" is the one commonly used) which specifies that all the following arguments are not switches? As a (somewhat useless) bonus, this also allows for files with the same names as switches.