I'm getting the same linker error when trying to run code:
ld.lld: error: undefined symbol: Serialize::Archive& Serialize::Archive::operator>><double>(double&)
main.cpp (snippets):
using namespace Serialize;
Archive arc(file, Archive::Save_Archive);
double test;
std::cout<<"Enter some data: ";
std::cin >> test;
arc >> test;
Archive.hpp:
namespace Serialize{
template<typename T>
Archive& operator>>(T& obj);
}
Archive.cpp:
namespace Serialize{
template<typename T>
Archive& Archive::operator>>(T& obj){};
}
I don't believe I have any namespace issues and the operator is only defined and declared once in the hpp and cpp files.
I tried switching around using namespace Serialize and namespace Serialize and even just doing
Serialize::Archive arc(file, Serialize::Archive::Save_Archive);