Re: can my library link with a library
From: Joe Hagen (jdhagen_at_chorus.net)
Date: 05/09/04
- Next message: kal: "Re: CreateProcess question"
- Previous message: Stevo: "TypeLib enum value"
- In reply to: Stuart: "Re: can my library link with a library"
- Next in thread: Carl Daniel [VC++ MVP]: "Re: can my library link with a library"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 8 May 2004 19:31:14 -0600
Stuart,
The LIB utility can combine library as well
as OBJ files.
Extracting the OBJ files isn't as convenient, since
the LIB utility doesn't support extraction using wild-
cards. You must specify each OBJ file separately.
This involves first getting the files using the /list option.
In your case, you can combine all the extra lib files
with your obj or lib files by doing the following:
lib /out:liball.lib a.lib b.lib c.lib myobj1.obj myobj2.obj
In this example, "liball.lib" is the output file and will
contain all of the object files from the libraries and
any object files specified on the command line.
Joe
Stuart wrote:
> Tim,
> Thanks so much for your help. How do I know what obj files the
> code in my library depends on?
>
> Can you explain how I would extract the OBJ files from all the
> various libs?
>
> thanks,
> Stuart
>
>
>
> "Tim Robinson" <tim.at.gaat.freeserve.co.uk@invalid.com> wrote in
> message news:2g1obmF3d1dpU1@uni-berlin.de...
>> Stuart wrote:
>>> I'm trying to create a static library for use by another
>>> developer. I'm somewhat new to libraries, so my question may not
>>> make sense, but here is what I'm wondering:
>>>
>>> Suppose my library calls functions that require linking with other
>>> libraries. Can I build my library such that it includes those
>>> dependent libraries as one entitiy?
>> [...]
>>
>> A library is just an bunch of .OBJ files within a .LIB file. You
>> could use the LIB program to extract all the .OBJs from the
>> dependent libraries and merge them into yours.
>>
>> If you're not worried about sending out the dependent library files,
>> you can use a #pragma directive to cause a program to link with both
>> libraries. You'd still have to send out several .LIBs when you
>> distributed your library, but you wouldn't have to worry about
>> linking to all of them.
>>
>> For example, in a source file that requires dependent_library.lib:
>> #pragma comment(lib, "dependent_library.lib")
>>
>> --
>> Tim Robinson (MVP, Windows SDK)
>> http://mobius.sourceforge.net/
- Next message: kal: "Re: CreateProcess question"
- Previous message: Stevo: "TypeLib enum value"
- In reply to: Stuart: "Re: can my library link with a library"
- Next in thread: Carl Daniel [VC++ MVP]: "Re: can my library link with a library"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|