First to answer your question:
Crypto++ has explicit template instantiations to be able to keep its
awesome, flexible template based architecture while at the same time
being able to put actual worker-code into CPP files and to be able to
compile into a DLL.
As for why you get all these additional includes:
zlib.h depends on zinflate.h (decompression), zdeflate.h (compression),
adler32.h (checksum) and cryptlib.h (general interfaces)
zinflate adds secblock.h (secure memory), filters.h (pipelined
compression) and stdcpp.h (STL access) to the list
zdeflate also add misc.h (misc. helper functions)
misc adds config.h (configuration options) and smartptr.h to the list
stdcpp, secblock, smartptr add nothing new
and so on and so forth
However, what you describe isn't (completely) caused by that.
You suffer from the fact that you actually compile cryptlib.cpp, which
is the main implementation for a lot of things in the library, this also
depends on the FIPS 140 code, which in turn wants to compile self-tests
for everything eligible for FIPS certification.
Did you try restricting your compilation to zlib, zinflate and zdeflate
and only add what otherwise gives linker errors?
BR
JPM
Am 16.06.2016 um 15:21 schrieb Vinnie Falco:
> I'm trying to adapt cryptopp's zlib codec as a set of independent
> header-only classes. Is it just me or is the structure of the cryptopp
> library rather odd? There are explicit template instantiations, and
> the way that the sources are organized adding one file triggers a
> cascade of dependencies that forces you to include almost everything.
>
> I'm still getting link errors about missing things like
> AbstractGroup<Integer>::CascadeScalarMultiply even after adding a ton
> of files that shouldn't even be needed. These are the translation
> units I have had to include so far to bring down the number of link
> errors in my project:
>
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/adler32.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/algebra.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/algparam.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/asn.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/cpu.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/cryptlib.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/fips140.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/filters.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/integer.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/iterhash.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/misc.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/mqueue.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/nbtheory.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/pubkey.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/queue.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/sha.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/xtr.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/zdeflate.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/zinflate.cpp
> ${PROJECT_SOURCE_DIR}/include/beast/core/impl/cryptopp/zlib.cpp
>
> What does SHA1 have to do with zlib? Or fips140? Or asn? Or most of
> that stuff, really?
>
> --
> --
> You received this message because you are subscribed to the "Crypto++
> Users" Google Group.
> To unsubscribe, send an email to
> [email protected].
> More information about Crypto++ and this group is available at
> http://www.cryptopp.com.
> ---
> You received this message because you are subscribed to the Google
> Groups "Crypto++ Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.