开发者

two static libraries

开发者 https://www.devze.com 2022-12-23 12:54 出处:网络
I am currently providing a static library using vs2008. I am in the process of building my static library. However, since I am using another static library is there a way that i package this as a sing

I am currently providing a static library using vs2008. I am in the process of building my static library. However, since I am using another static library is there a way that i package this as a single static library. The reason here is that they will be calling functions in my library that depend on that other s开发者_JS百科tatic library (.lib). I am not sure how to go about doing that and need some help with that.


Look under project properties | Configuration Properties | Librarian | General

Put the name of the library (.lib) file you want to add to your library under "Additional Dependencies"

You may also have to set the "Additional Library Directories" setting so that it can find the library.


Here is one way:

  1. Find out all the object files in the static library. That can be done by running the command lib STATICLIB /list
  2. Extract each object listed. You must give the exact name from step 1 (lib STATICLIB /extract:.\debug\foo.obj)
  3. You can then add all the objects extracted form step 2 into your library


VC++ includes a command line library manager called lib.exe. It can me used to combine both object files and library files into a single library.

It may not be relevant to your case, but in some cases combining a third-party library to your own and distributing that as a library rather than a final application, (or in the case of many open source licenses, the source), may contravene the license terms for that library. So apply some caution in such cases.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号