Thread overview | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 04, 2005 lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
I don't know why I've never run into this before, but I'm getting dmc -c -wx -I..\..\include -Ih:\dev\include -Ih:\dev\incpriv -DWIN32 -DNDEBUG -o.\b64.obj ..\..\src\b64.c lib /c /n ..\..\lib\b64.dm.lib .\b64.obj,,..\..\lib\b64.dm.lib; Digital Mars Librarian Version 8.00n Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com Error: Create requested, but '..\..\lib\b64.dm.lib' already exists. Is there an option to create-or-append? I'm resorting to deleting the lib if it exists in its rule, but it seems a bit brutal. Cheers -- Matthew Wilson Author: "Imperfect C++", Addison-Wesley, 2004 (http://www.imperfectcplusplus.com) Contributing editor, C/C++ Users Journal (http://www.synesis.com.au/articles.html#columns) STLSoft moderator (http://www.stlsoft.org) ------------------------------------------------------------------------------- "So far, C++ is the best language I've discovered to say what I want to say" -- Alex Stepanov ------------------------------------------------------------------------------- |
February 04, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | Yeah... use -+.\b64.obj That will remove and add it. Matthew wrote: > I don't know why I've never run into this before, but I'm getting > > dmc -c -wx -I..\..\include -Ih:\dev\include -Ih:\dev\incpriv -DWIN32 -DNDEBUG -o.\b64.obj ..\..\src\b64.c > lib /c /n ..\..\lib\b64.dm.lib .\b64.obj,,..\..\lib\b64.dm.lib; > Digital Mars Librarian Version 8.00n > Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com > > Error: Create requested, but '..\..\lib\b64.dm.lib' already exists. > > Is there an option to create-or-append? > > I'm resorting to deleting the lib if it exists in its rule, but it seems a bit brutal. > > Cheers > > -- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org |
February 05, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | Thanks "Jan Knepper" <jan@smartsoft.us> wrote in message news:cu0mvc$7lg$1@digitaldaemon.com... > Yeah... use -+.\b64.obj > That will remove and add it. > > > > Matthew wrote: >> I don't know why I've never run into this before, but I'm getting >> >> dmc -c -wx -I..\..\include -Ih:\dev\include -Ih:\dev\incpriv >> -DWIN32 -DNDEBUG -o.\b64.obj ..\..\src\b64.c >> lib /c /n ..\..\lib\b64.dm.lib >> .\b64.obj,,..\..\lib\b64.dm.lib; >> Digital Mars Librarian Version 8.00n >> Copyright (C) Digital Mars 2000-2002 All Rights Reserved >> www.digitalmars.com >> >> Error: Create requested, but '..\..\lib\b64.dm.lib' already >> exists. >> >> Is there an option to create-or-append? >> >> I'm resorting to deleting the lib if it exists in its rule, but it seems a bit brutal. >> >> Cheers >> >> > > > -- > ManiaC++ > Jan Knepper > > But as for me and my household, we shall use Mozilla... www.mozilla.org |
February 06, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | On Fri, 04 Feb 2005 15:46:36 -0500, Jan Knepper wrote: > Yeah... use -+.\b64.obj > That will remove and add it. > > Matthew wrote: >> I don't know why I've never run into this before, but I'm getting >> >> dmc -c -wx -I..\..\include -Ih:\dev\include -Ih:\dev\incpriv >> -DWIN32 -DNDEBUG -o.\b64.obj ..\..\src\b64.c >> lib /c /n ..\..\lib\b64.dm.lib >> .\b64.obj,,..\..\lib\b64.dm.lib; >> Digital Mars Librarian Version 8.00n >> Copyright (C) Digital Mars 2000-2002 All Rights Reserved >> www.digitalmars.com >> >> Error: Create requested, but '..\..\lib\b64.dm.lib' already exists. >> >> Is there an option to create-or-append? >> >> I'm resorting to deleting the lib if it exists in its rule, but it seems a bit brutal. >> >> Cheers >> >> Thanks! I've just started running in to this problem too. I'm adding the ability to update a library from my 'build' utility and spent a hour or so trying hard to get it working, but failing miserably. -- Derek Melbourne, Australia 7/02/2005 9:30:38 AM |
February 14, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | Jan Knepper wrote:
> Yeah... use -+.\b64.obj
> That will remove and add it.
>
But isn't that considered 'obsolete' usage? Is there a 'new' usage to accomplish this?
--
TimJ
|
February 14, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to tjulian | lib -h Digital Mars Librarian Version 8.00n Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com Documentation: www.digitalmars.com/ctg/lib.html Obsolete Usage: LIB oldlibfile [switches] [actionobjs][,[listfile][,[newlibfile]]][;] switches: /? Print this message /b Batch /c Create library if one does not exist /h Print this message /i Ignore case of symbols /n Do not create backup file /noi Be case sensitive. Mark library as case sensitive /p:number Set page size to number (a power of 2) actions: -mod Delete module +mod Add module *mod Extract module -+mod Replace module -*mod Extract and delete module New Usage: LIB switches... libfile objfiles... -c create -d delete -h print this message -i ignore case of symbols -n do not create backup file -l create .lst file -pnnn set page size to nnn (a power of 2) -x extract tjulian wrote: > Jan Knepper wrote: > > >>Yeah... use -+.\b64.obj >>That will remove and add it. >> > > > But isn't that considered 'obsolete' usage? Is there a 'new' usage to > accomplish this? > > -- > TimJ -- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org |
February 15, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | Jan Knepper wrote:
> Obsolete Usage:
> LIB oldlibfile [switches]
> [actionobjs][,[listfile][,[newlibfile]]][;]
> switches:
> /? Print this message
> /b Batch
> /c Create library if one does not exist
> /h Print this message
> /i Ignore case of symbols
> /n Do not create backup file
> /noi Be case sensitive. Mark library as case sensitive
> /p:number Set page size to number (a power of 2)
> actions:
> -mod Delete module
> +mod Add module
> *mod Extract module
> -+mod Replace module
> -*mod Extract and delete module
>
> New Usage:
> LIB switches... libfile objfiles...
> -c create
> -d delete
> -h print this message
> -i ignore case of symbols
> -n do not create backup file
> -l create .lst file
> -pnnn set page size to nnn (a power of 2)
> -x extract
>
Exactly my point. The '-+mod' syntax is listed under 'obsolete' usage. The 'New' usage does not list 'actionobjs' as an option.
--
TimJ
|
February 25, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to tjulian | "tjulian" <tjulian@removethis.oldi.com> wrote in message news:cut3es$n5q$1@digitaldaemon.com... > Exactly my point. The '-+mod' syntax is listed under 'obsolete' usage. The 'New' usage does not list 'actionobjs' as an option. Just add the .obj file, it'll replace any existing one in the library. |
March 23, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | On Thu, 24 Feb 2005 21:16:52 -0800, Walter wrote: > "tjulian" <tjulian@removethis.oldi.com> wrote in message news:cut3es$n5q$1@digitaldaemon.com... >> Exactly my point. The '-+mod' syntax is listed under 'obsolete' usage. The 'New' usage does not list 'actionobjs' as an option. > > Just add the .obj file, it'll replace any existing one in the library. This lib tool is driving me crazy! All I want ot be able to do is have it add an object file if the file is not already in the library otherwise replace the object file currently in the library with the new one. And have this work with the response file concept. Here is some actual output from using lib ... ***************************************************** C:\dparnell\D_Proj\build\trunk\Source>del testl.lib C:\dparnell\D_Proj\build\trunk\Source>lib -l -c testl.lib testl.obj testm.obj Digital Mars Librarian Version 8.00n Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com Digital Mars Librarian complete. C:\dparnell\D_Proj\build\trunk\Source>type testl.lst Publics by name module _D5testl2piFZe testl _D5testm3abci testm Publics by module testl _D5testl2piFZe testm _D5testm3abci C:\dparnell\D_Proj\build\trunk\Source>lib -l testl.lib testl.obj testm.obj Digital Mars Librarian Version 8.00n Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com Warning: Public '_D5testl2piFZe' already in library, redefinition ignored. Warning: Public '_D5testm3abci' already in library, redefinition ignored. Digital Mars Librarian complete. ***************************************************** This seems to be saying that I *can't* "Just add the .obj file, it'll replace any existing one in the library" as you say. Now if I revert to the obsolete syntax I get this ... ******************************************* C:\dparnell\D_Proj\build\trunk\Source>del testl.lst C:\dparnell\D_Proj\build\trunk\Source>lib testl.lib /c -+testl.obj -+testm.obj,t estl.lst, Digital Mars Librarian Version 8.00n Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com Warning: 'testl.obj' not found, can't delete or extract it Warning: 'testm.obj' not found, can't delete or extract it Digital Mars Librarian complete. C:\dparnell\D_Proj\build\trunk\Source>type testl.lst Publics by name module _D5testl2piFZe testl _D5testm3abci testm Publics by module testl _D5testl2piFZe testm _D5testm3abci *************************************************** Now it can't find the object files in the library, even though they are plainly there. So has it updated the library or not? I can't tell. Also, you can seem to use the obsolete syntax with a response file ... *************************************************** C:\dparnell\D_Proj\build\trunk\Source>type testl.lsp testl.lib /c -+testl.obj -+testm.obj , , C:\dparnell\D_Proj\build\trunk\Source>lib @testl.lsp Digital Mars Librarian Version 8.00n Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com library file (.lib) testl.lib action-object [-+*] (.obj) /c list file (.lst) -+testl.obj Error: Unexpected char '-' in command line. *************************************************** So, how *do* I replace an existing module in a library? And using a response file? -- Derek Melbourne, Australia 23/03/2005 6:13:07 PM |
March 23, 2005 Re: lib: Is there an append-or-create option? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
>
> "tjulian" <tjulian@removethis.oldi.com> wrote in message news:cut3es$n5q$1@digitaldaemon.com...
> > Exactly my point. The '-+mod' syntax is listed under 'obsolete' usage. The 'New' usage does not list 'actionobjs' as an option.
>
> Just add the .obj file, it'll replace any existing one in the library.
That will work if the library exists, but what if the library does not yet exist and the command to build and insert an obj is in an implicit/inference rule of a makefile?
With the new syntax:
- adding the -c switch recreates the lib
- there is no way to create an empty lib
- cannot add to non-existing lib
Catch-22 with implicit/inference rules: cannot add to non-existing lib vs adding the -c switch recreates lib.
For example with smake:
mylib.lib: myfile1.obj myfile2.obj
.c.obj:
dmc -c $<
#how to add to lib if lib does not exist?
lib ?????
myfile1.obj: myfile1.c
myfile2.obj: myfile2.c
--
TimJ
|
Copyright © 1999-2021 by the D Language Foundation