我正在处理由其他人专业制作的项目,因此代码应该没有错误。我遇到的问题很可能与项目配置有关。
我正在尝试编译的项目的C和C ++源文件保存在以下文件夹中,所有这些都在项目目录中:硬件,头文件,源文件,TCP / IP,uTasker和WinSim。当我尝试编译时,它返回以下构建日志:
1>------ Build started: Project: uTasker, Configuration: Debug Win32 ------
1>LPC17XX.obj : error LNK2019: unresolved external symbol _fnOpenDefaultHostAdapter referenced in function _fnConfigEthernet
1>WinSim.obj : error LNK2001: unresolved external symbol _iWinPcapSending
1>WinSim.obj : error LNK2019: unresolved external symbol _fnWinPcapSendPkt referenced in function _fnSimulateEthTx
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnDoEthereal(int,char *)" (?fnDoEthereal@@YAXHPAD@Z) referenced in function _WinMain@16
1>WinSimMain.obj : error LNK2001: unresolved external symbol "int iTxActivity" (?iTxActivity@@3HA)
1>WinSimMain.obj : error LNK2001: unresolved external symbol "int iRxActivity" (?iRxActivity@@3HA)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnWinPcapStopLink(struct HWND__ *)" (?fnWinPcapStopLink@@YAXPAUHWND__@@@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnWinPcapSelectLAN(int)" (?fnWinPcapSelectLAN@@YAXH@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnWinPcapOpenAdapter(void)" (?fnWinPcapOpenAdapter@@YAXXZ) referenced in function "long __stdcall SetNIC(struct HWND__ *,unsigned int,unsigned int,long)" (?SetNIC@@YGJPAUHWND__@@IIJ@Z)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnWinPcapClose(void)" (?fnWinPcapClose@@YAXXZ) referenced in function "long __stdcall SetNIC(struct HWND__ *,unsigned int,unsigned int,long)" (?SetNIC@@YGJPAUHWND__@@IIJ@Z)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "int __cdecl fnShowNICs(struct HWND__ *)" (?fnShowNICs@@YAHPAUHWND__@@@Z) referenced in function "long __stdcall SetNIC(struct HWND__ *,unsigned int,unsigned int,long)" (?SetNIC@@YGJPAUHWND__@@IIJ@Z)
1>.\Debug\uTasker.exe : fatal error LNK1120: 11 unresolved externals
LPC17XX.c保存在Hardware / LPC17XX文件夹中。
WinSim.c和WinSimMain.cpp保存在WinSim文件夹中。
我不确定如何配置我的链接器来解决这些问题,我们将不胜感激。
编辑:我正在使用Visual Studio 2010来构建项目。
答案 0 :(得分:1)
关于WinPCap的文档与我能够找到的文档有点过时,但是有一些非常重要的设置说明,特别是应该定义的预处理器宏,以便为正常设置正确的设置链接。
我能找到的最新设置文档是here。我希望他们帮助你前进。