我正在编写一个显示矩形和三角形形状的程序,并计算这些形状的区域。我正在使用Microsoft Visual Studio。这些是我的代码:
我有四个代码和错误列表的图像:Shapes.h,shapesfunchtions3.h,shapes3.cpp和testshapes3.cpp
Mediafire Folder of my four codes
但是我得到了这个错误:对此有什么解决方法吗?
如果你看不到错误列表的图像,那就是:
错误1
错误LNK2019:未解析的外部符号“public:void __thiscall Shapes :: DisplayMenu(void)”(?DisplayMenu @ Shapes @@ QAEXXZ)在函数“public:char __thiscall Shapes :: SelectShape(void)”中引用(?SelectShape @ Shapes @@ QAEDXZ)C:\ Users \ Eduardo \ Documents \ Mission College \ Projects \ shapes3 \ shapes3 \ shapes3.obj
错误2
错误LNK2019:未解析的外部符号“public:void __thiscall Shapes :: GetSelection(void)”(?GetSelection @ Shapes @@ QAEXXZ)在函数“public:char __thiscall Shapes :: SelectShape(void)”中引用(?SelectShape @ Shapes @@ QAEDXZ)C:\ Users \ Eduardo \ Documents \ Mission College \ Projects \ shapes3 \ shapes3 \ shapes3.obj
错误3
错误LNK2019:未解析的外部符号“public:void __thiscall Shapes :: CheckSelection(void)”(?CheckSelection @ Shapes @@ QAEXXZ)在函数“public:char __thiscall Shapes :: SelectShape(void)”中引用(?SelectShape @ Shapes @@ QAEDXZ)C:\ Users \ Eduardo \ Documents \ Mission College \ Projects \ shapes3 \ shapes3 \ shapes3.obj
错误4
错误LNK1120:3个未解析的外部C:\ Users \ Eduardo \ Documents \ Mission College \ Projects \ shapes3 \ Debug \ shapes3.exe
答案 0 :(得分:0)
您实现了此功能:(您需要更改此内容:)
void DisplayMenu()
{
// ...
}
但它不同于:(对此:)
void Shapes::DisplayMenu()
{
// ...
}
这样做:
void GetSelection()
和此:
void CheckSelection()