计算机二级试题代码与答案对照无误,但出现链接错误。

错误 5 error LNK1120: 3 个无法解析的外部命令 C:\WEXAM\000000000000\Debug\proj3.exe proj3
错误 2 error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class std::locale::facet * thiscall std::locale::facet::_Decref(void)" (imp_?_Decref@facet@locale@std@@QAEPAV123@XZ),该符号在函数 "public: thiscall std::locale::~locale(void)" (??1locale@std@@QAE@XZ) 中被引用 C:\WEXAM\000000000000\proj3\writeToFile.obj 1 1 proj3
错误 3 error LNK2019: 无法解析的外部符号 "
declspec(dllimport) public: void thiscall std::locale::facet::_Incref(void)" (imp_?_Incref@facet@locale@std@@QAEXXZ),该符号在函数 "class std::codecvt const & __cdecl std::use_facet >(class std::locale const &)" (??$use_facet@V?$codecvt@DDH@std@@@std@@YAABV?$codecvt@DDH@0@ABVlocale@0@@Z) 中被引用 C:\WEXAM\000000000000\proj3\writeToFile.obj 1 1 proj3
错误 4 error LNK2019: 无法解析的外部符号 "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPAV123@@Z),该符号在函数 "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) 中被引用 C:\WEXAM\000000000000\proj3\writeToFile.obj 1 1 proj3
错误 1 error LNK2038: 检测到“_MSC_VER”的不匹配项: 值“1600”不匹配值“1800”(main.obj 中) C:\WEXAM\000000000000\proj3\writeToFile.obj 1 1 proj3

obj bin全部删除重新编译。
你的程序是用旧版的vc++编译的,所以链接错误。