podofo / podofo

A C++17 PDF manipulation library

Home Page:https://podofo.github.io/podofo/documentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static library size

tayei1997 opened this issue · comments

commented

Hello, thanks for this amazing lib !

I am using podofo to implement content reading functionality for PDF files. Previously I was using vckpg to manage podofo's dynamic libraries, currently I need to use only static libraries。

however, both the static libraries I compiled myself and the static libraries I built using vcpkg, the size of the libraries are more than 130M.

has anyone else also tried to compile the static libraries of podofo, and is the size of these libraries normal?

Also, is there any way to reduce the size of the static libraries (e.g. by disabling some dependencies that I can't use, is that possible)?

Could you help me?
Thanks!

3drparty dependencies: see https://github.com/podofo/podofo-deps . Those are the reference precompiled dependencies. There's no concern over the size of those.

PoDoFo library itself: Platform? Debug or release? For example the debug podofo.lib in Windows is quite big (112mb) but I believe it should be normal since a lot of common symbols get compiled in each compilation unit over and over. Some debug information can also clutter the static library as well. This is something that precompiled headers should solve, but that's not enabled since precompiled headers are not too widely appreciated. In the far future this should be possibly solved by C++ modules. In general the size of the static library should be no concern since in the end everything gets size optimized during linking of the final executable/dynamic library.

commented

Thank you for your reply.

I am compiling on windows64 and debug. The version where I configured the dependencies myself only configured zlip, openssl, freetype and libxml2, and after compiling I got a 133M .lib file, however it doesn't work ( Error LNK2019 Unable to resolve external symbols "__declspec(dllimport) public: unsigned int __cdecl PoDoFo::PdfPageCollection::GetCount(void) const " (_imp?GetCount@PdfPageCollection@PoDoFo@@QEBAIXZ), which is referenced in function main...).
I then tried to use vcpkg to build the static library for podofo and got podofo.lib (220M) and podofo_private.lib (18M) under debug, but still got the above error.

Are you suggesting that I use these pre-compiled libraries to compile podofo, and can these libraries be downloaded and used directly?

Please refer to the new static linking section of the readme about using precompiled static builds of PoDoFo. You should deal with the linking issues yourself as this is a scenario that will not receive support here.

commented

Okay, thanks for your patience.

commented

Hi,in https://github.com/podofo/podofo, there are descriptions of requirements for dependent libraries, where openssl specifies its required version, so the other libraries don't have specific version requirements do they?

I specified tentative minimum versions based on what I started using in 2018. I believe there won't be any requirements upgrade in years to come.