问题遇到的现象和发生背景
用mac编译的时候出现这样错误,用clion、xcode、还有vscode编译都是这样错误。
问题相关代码,请勿粘贴截图
CVector();
CVector(const CVector& vct);
CVector(CVector&& vct);
CVector& operator=(const CVector&cvt);
virtual ~CVector();
uint32_t Insert(uint32_t nPos,uint32_t nVal);//指定位置插入
uint32_t PushHead(uint32_t nVal);//头部插入
uint32_t PushTail(uint32_t nVal);//尾部插入
运行结果及报错内容
Undefined symbols for architecture arm64:
"vtable for CVector", referenced from:
CVector::CVector() in CVecotr-60a999.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)