vendredi 20 décembre 2019

How can i handle undefined method of my templated class problem

template<class T>
class myType
{
    public:
        myType();
        void add(const T& Object);
    private:
        .
        .
        .
};

int main()
{
    myType <int> temp;
    temp.add(2);
}

I take an undefined message

driver.cpp:(.text+0xc6): undefined reference to myType<int>::myType()' driver.cpp:(.text+0xe0): undefined reference tomyType::add(int const&)'

How can i handle this case? myType.h and myType.cpp implemented correctly and i included "myType.h" on driver.cpp

Aucun commentaire:

Enregistrer un commentaire