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

前端 未结 1 875
既然无缘
既然无缘 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 in your friend declaration in class Vector.

    template 
    friend ostream& operator <<(ostream& out, Vector x);
    
    template 
    friend bool operator == (const Vector &lop, const Vector &rop);
    

    0 讨论(0)
提交回复
热议问题