If you have different libraries (I guess different dynamic libraries), then you may have some duplication of both code and static variables.
The exact details will depend on the particular dynamic library technology you are using. I would say that, for example, in the Windows DLL you will have duplicated code and variables, but in Linux SOs you will not.
, .
UPDATE: , - ! - ! , , , SO . , , std::string, :
:
namespace std
{
extern template class basic_string<wchar_t>;
}
:
namespace std
{
template class basic_string<wchar_t>;
}
, , . , SO , , .
UPDATE: , , ... , extern, ELF .
. . , -fvisibility=hidden . , :
template <class OBJECT>
struct __attribute__((visibility("default"))) Container
{
static int m_member;
};
, , .