Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use static library libzip.lib in a new DLL project

Chris Miller

Programmer
Oct 28, 2020
4,942
DE
I discovered git repositories that alleviate building Dynamic and static versions of zlib and libzip:


To be precise, these projects build from the get go with no problems in their VS2022 version (at least, I assume also in older VS versions). Very nice.

Now I thought it's easy enough to take libzip.lib and build a new DLL project using that and offering two simple functions a) ZipDir to zip all files of a directory (recursive with subdirectories) and and b) UnZip a zip file to a target directory. I fail to integrate the static lib into a new DLL project. The problem seems to me in the structure of header files that's too complex. I first tried to link to the libzip project folders and then tried to stuff all header files of the libzip project into one new directory of my solution together with the lib and it gives less errors but still lists over hundred errors starting with "cannot open zipcomf.h" within zip.h and cascading in lots of undefined identifiers of classes/structs etc.

I mainly followed the steps of https://learn.microsoft.com/en-us/c...ects?view=msvc-170#consuming-static-libraries for sttic libraries.

Now I also tried to simply include zlib-static and llibzip-static projects into my new project but still the same overall mess with include file processing.

Would anybody care to look into this? Specifically for these static libs, not just generally?
 
Last edited:

Part and Inventory Search

Sponsor

Back
Top