rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
627 stars 114 forks source link

Is it possible to use the library with static linking? #10

Closed xplicit closed 7 years ago

xplicit commented 7 years ago

I'm looking for a static library which allows to unzip files with password. From the description of bit7z I see it supports static linking and extracting files with password but from docs I noticed that I have to put 7za.dll into the running directory. Does this library support fully static linking? I'd like to compile single exe without additional dll dependencies.

rikyoz commented 7 years ago

Unfortunately no, it doesn't support fully static linking. bit7z does support static linking (actually, it is meant to be linked only statically!), but it uses dynamic linking to access the functionalities of the 7-zip dlls, given that it was designed to be a simple interface to the latter!

xplicit commented 7 years ago

It would be great to have this ability because API of bit7z is really simple. As far I understand 7-zip also have the ability to statically link libs. If I'm not wrong this can be used to extend bit7z library.

rikyoz commented 7 years ago

Yeah, technically it should be possible to extend bit7z to support fully static linking! The problem is that I still need to figure out how different is the usage of 7-zip code when it is statically linked: unfortunately the 7-zip code is really a mess and it is mostly undocumented so it's not so easy (at least to me)! I feel like it would probably require too many changes in the actual code and currently I'm quite busy on other jobs, but when I'll find some time I'll try to figure this out. Nevertheless I don't think that I'll make it available for the next minor version (v2.2). If the changes to do are too big, probably I will release it in a v3.0 version (with other major improvements that I've already planned). P.S. I'll reopen this issue in the event that I have managed to solve it!