0

I create a static lib(set a.lib as an example) file for other poeple to use my API function, however, I use other API function by colleagues(these APIs are fulfilled in b.lib, c.lib, ...). When I test on a new project just include a.lib, I'll get an error,"unsolved external symbol...". I wonder whether there is a method to only offer the a.lib to users who use my API funcitons. So other static lib files(b.lib, c.lib, ...) are no need to offer to users any more.

Nathan_hnl
  • 13
  • 5

1 Answers1

0

I think you can combine multiple static libraries together as a one *.lib using visual studio command prompt.

Use Lib command something like lib /OUT:filename.lib input1.lib input2.lib ....

This is the reference page https://msdn.microsoft.com/en-us/library/7ykb2k5f.aspx

And this may help: Linking static libraries to other static libraries

Community
  • 1
  • 1
Nayana Adassuriya
  • 19,806
  • 20
  • 87
  • 131
  • I have read the artile from the reference page you offered before. I didn't describe the question clearly.The situation I encount is much different. User only needs a.lib, because all the APIs they need are fulfilled in a.lib. However, some function in a.lib use other APIS in b.lib or other static lib. If an user only include a.lib in the project file, then an error happens. – Nathan_hnl Oct 26 '15 at 03:30
  • So you could combine `a.lib` and `b.lib` as `c.lib` and ask yours to use `c.lib` – Nayana Adassuriya Oct 26 '15 at 03:52
  • Many thanks, and that works. – Nathan_hnl Oct 26 '15 at 06:19