我有个问题,有哪位大哥给解释一下
我定义了一个类,.h文件 又写了类的实现 .cpp
第三个文件是类的使用
这样第三个文件怎么编译都是编译不了
但是把三个文件都放到一文件里的话,就没问题
程序在附件里
[此贴子已经被作者于2006-7-28 22:33:15编辑过]
[此贴子已经被作者于2006-7-28 22:33:15编辑过]
提示是错误如下“
EmployeeTest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Records::Employee::display(void)" (?display@Employee@Records@@QAEXXZ)
EmployeeTest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Records::Employee::hire(void)" (?hire@Employee@Records@@QAEXXZ)
EmployeeTest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Records::Employee::promote(int)" (?promote@Employee@Records@@QAEXH@Z)
EmployeeTest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Records::Employee::setSalary(int)" (?setSalary@Employee@Records@@QAEXH@Z)
EmployeeTest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Records::Employee::setEmployeeNumber(int)" (?setEmployeeNumber@Employee@Records@@QAEXH@Z)
EmployeeTest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Records::Employee::setLastName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?setLastName@Employee@Records@@QAEXV?$bas
ic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
EmployeeTest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Records::Employee::setFirstName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?setFirstName@Employee@Records@@QAEXV?$b
asic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
EmployeeTest.obj : error LNK2001: unresolved external symbol "public: __thiscall Records::Employee::Employee(void)" (??0Employee@Records@@QAE@XZ)
Debug/EmployeeTest.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.
EmployeeTest.exe - 9 error(s), 0 warning(s)
不知道是不是编译器的问题