问编译中出现的一个小问题如何解决?为什么会出现这样的问题?

来源:百度知道 编辑:UC知道 时间:2024/09/22 07:21:10
Linking...
Li5_5View.obj : error LNK2001: unresolved external symbol "public: __thiscall CSquare::CSquare(class CWnd *)" (??0CSquare@@QAE@PAVCWnd@@@Z)
Debug/Li5_5.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Li5_5.exe - 2 error(s), 0 warning(s)

可能是含有CSquare类定义的文件没在工程里

注意一下您声明的函数或者类,可能是实参与形参的个数不一致所致。
比如声明时为int compare(int a, int b);
调用或编写代码为int compare(int a, int b, int c){}

构造函数没小心删了还是怎么
或者这个构造函数需要一个CWnd参数
加入
CSquare::CSquare(class CWnd *)
{
}