It's not allowed to mark the class template. Only explicit instantiation can be marked with dllexport/import attributes.