// base.h #ifndef BASE_INC #define BASE_INC #include <Eigen/Eigen> class Base { public: Base ();
~Base (); }; // ----- end of class Base ----- #endif // ----- #ifndef BASE_INC -----
If I compile these into a static library, all is fine. But using gcc and compiling into a shared library, the objects are made fine, but the call to the linker fails.
derived.os: In function `Eigen::l1CacheSize()':
derived.cpp:(.text+0x25cf): multiple definition of `Eigen::l1CacheSize()' base.os:base.cpp:(.text+0x25cf): first defined here derived.os: In function `Eigen::setL1CacheSize(long)': derived.cpp:(.text+0x25f8): multiple definition of `Eigen::setL1CacheSize(long)'
base.os:base.cpp:(.text+0x25f8): first defined here
Is there some way around this? This type of code has been fine before some recent changes. I know these changes should help performance though. Maybe there are compelling reasons why you shouldn't be including Eigen in any base classes?