ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

前端 未结 1 856
既然无缘
既然无缘 2021-01-27 20:59

I have to do a custom \"vector\" class in c++ as homework for my university but I\'m struggling with the templates.

I get this error after I change all the variables\'

相关标签:
1条回答
  • 2021-01-27 21:29

    You should add template <typename T> in your friend declaration in class Vector.

    template <typename T>
    friend ostream& operator <<(ostream& out, Vector<T> x);
    
    template <typename T>
    friend bool operator == (const Vector<T> &lop, const Vector<T> &rop);
    
    0 讨论(0)
提交回复
热议问题