Recently, I compiled Eigen3 and use it to do some linear algebra task at Windows.
But I wonder why Eigen3 doesn't need to link additional lib or DLL (I just need to include its header)
Does Eigen do all calculating at compile time? Or do I miss understanding something?
If so, what is the category name of this kind library
Like all C++ template libraries, Eigen is completely contained in the header file and inserted in the source file everytime. So it does not contain on any cpp files, which would be compiled to a dll.
The distinction between dll/lib and header occurs when the classes are declared in the header and implemented in a cpp file. Then the implementation part is always the same and can be loaded from a dll.
However, in a template library, the classes are not finished, since they depend on the template parameters you pass to them. e.g. if you write Matrix<float, 17, 19>
, you create a new complete class with a completely new implementation, which could not be loaded from a dll.
This also makes c++ programs that uses a lot of templates (like many different fixed size matrices), very big.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With