|
-
February 1st, 2012, 09:30 AM
#1
Static lib question
Is there a way to build a static lib so that it links in other static libs?
In other words, if I build a lib A as a static lib, and it has a dependency on another static lib B. Is there a way for me to build A such that it incorporates the necessary parts of B so that I only have to ship A and not A and B?
To give an example, I have a colleague who is building a library that has a dependency on boost thread. The interface header of his library uses pointer to implementation, and therefore does not expose anything unnecessary. The issue that he is having is that when he builds his library, he would like it to link in the required sections from boost thread so that when he builds a final application, the final application will not need the boost library at link time.
Anyway, it's not obvious how to do this, or if it is even possible.
Any advice would be appreciated.
-
February 1st, 2012, 09:56 AM
#2
Re: Static lib question
Of course. Just link in the other libraries as you would with any other project.
-
February 1st, 2012, 10:04 AM
#3
Re: Static lib question
For some reason that's not working. The library is not actually linking in the sections from boost thread that it requires when it links, therefore the final application is complaining that it needs the boost static lib in order to do the final link.
-
February 1st, 2012, 11:48 AM
#4
Re: Static lib question
I didn't think that the linker does anything when building static libraries, other then to collect all the object files into one .lib file (in other words, nothing is actually linked).
Have you looked at the Library Manager that comes with Visual Studio? This might suit your needs.
Viggy
-
February 1st, 2012, 12:26 PM
#5
Re: Static lib question
 Originally Posted by MrViggy
I didn't think that the linker does anything when building static libraries, other then to collect all the object files into one .lib file (in other words, nothing is actually linked).
That would explain it.
 Originally Posted by MrViggy
Have you looked at the Library Manager that comes with Visual Studio? This might suit your needs.
Viggy
Thanks, I'll take a look.
-
February 1st, 2012, 12:28 PM
#6
-
February 1st, 2012, 03:12 PM
#7
Re: Static lib question
Man... what's happened with my memory? Had totally forgot that post... 
Thanks for reminding me though Codeplug.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|