g++ -pedantic-errors -Wall -Wextra -Werror -std=c++17 -o
-L/usr/lib -lstdc++ -lm -I
/usr/bin/ld: /mnt/c/users/ahmedrahim/workspace/repos/rvbaselib/build/objects//mnt/c/users/ahmedrahim/workspace/repos/rvbaselib/source/main/rvbaseuint64property.o: в функции Rvbaseuint64property :: rvbaseuint64property (std :: __ cxx11 :: basic_string , unsigned long) ': rvbaseuint64property.cpp

/usr/bin/ld: /mnt/c/users/ahmedrahim/workspace/repos/rvbaselib/build/objects//mnt/c/users/ahmedrahim/workspace/repos/rvbaselib/source/main/rvbaseuint64property.o: в функции Rvbaseuint64property :: ~ rvbaseuint64property () ': rvbaseuint64property.cpp

/usr/bin/ld: ld: /mnt/c/users/ahmedrahim/workspace/repos/rvbaselib/build/objects//mnt/c/users/ahmedrahim/workspace/repos/rvbaselib/source/tests/sanity_tests/sanity.o: in function main ': sanity. < /code> rvbaseproperty :: print () const '
collect2: ошибка: LD вернул 1 статус выхода < /p>
< /blockquote>
Насколько мне известно, не должно быть никаких проблем, касающихся наследства от шаблон, начиная с C ++ 17. Я не уверен, что здесь идет не так. Кто-нибудь может помочь?template class RvBaseProperty
{
private :
string mName {"Undefined"};
T mValue;
bool mValid {false};
static uint64_t mBasePropertyRefCount;
public :
explicit RvBaseProperty(string _name, T _value);
~RvBaseProperty();
...
void Print() const;
};
< /code>
rvbaseproperty.cpp-только соответствующие детали, показанные.#include "RvBaseProperty.h"
using namespace std;
template uint64_t RvBaseProperty::mBasePropertyRefCount = 0;
// ========================================================================
template RvBaseProperty::RvBaseProperty(
string _name,
T _value) :
mName (_name),
mValue (_value)
// ========================================================================
{
SetValid();
++mBasePropertyRefCount;
}
// ========================================================================
template RvBaseProperty::~RvBaseProperty()
// ========================================================================
{
--mBasePropertyRefCount;
}
< /code>
baseuint64property.h
#include "RvBaseProperty.h"
class RvBaseUInt64Property : public RvBaseProperty
{
public:
explicit RvBaseUInt64Property(string _name, uint64_t _value);
~RvBaseUInt64Property();
};
//baseuint64property.cpp
#include "RvBaseUInt64Property.h"
// ========================================================================
RvBaseUInt64Property::RvBaseUInt64Property(
string _name,
uint64_t _value) :
RvBaseProperty::RvBaseProperty(_name, _value)
// ========================================================================
{}
// ========================================================================
RvBaseUInt64Property::~RvBaseUInt64Property()
// ========================================================================
{}
< /code>
main (): < /p>
RvBaseUInt64Property const * prop0 = new RvBaseUInt64Property("uint64_t", 99);
prop0->Print();
Подробнее здесь: https://stackoverflow.com/questions/797 ... base-class