error LNK2001: unresolved external symbol?该怎么处理

error LNK2001: unresolved external symbol???
我写了一个a.h文件:
class a{
public:
int set();
};
然后在a.cpp中实现set函数
#include "a.h"
int a::set()
{
return 123;
}

我新建一个工程,把a.h和a.cpp文件放到当前目录下,在工程中包含a.h,并调用set函数:
#include <iostream.h>
#include "a.h"
void main()
{
class a ts;
int s= ts.set();
cout<<s<<endl;
}

报错:
main.obj : error LNK2001: unresolved external symbol "public: int __thiscall a::set(void)" (?set@a@@QAEHXZ)
Debug/test5.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

如何解决???

------解决方案--------------------
首先
没必要用
C/C++ code
class a ts;

------解决方案--------------------
在工程中包含a.h

很明显没在工程里加入a.cpp
------解决方案--------------------
探讨
引用:
在工程中包含a.h

很明显没在工程里加入a.cpp


嗯,谢谢你的回答,我是没有加进来。

我之前试了试把.cpp加进来,然后出现了很多错误,和警告,改都不好改,所以我放弃了这种方法,看来我还是得再试试这种方法了。。。