我正在与其他人专业制作的项目一起工作,因此代码应无错误。我遇到的问题最有可能与项目配置有关。

我要编译的项目的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构建项目。

最佳答案

WinPCap上的文档与我已经找到的文档有些过时了,但是有一些非常重要的设置说明,尤其是应该定义预处理器宏,以便正确地进行设置以实现良好的链接。

我可以找到的最新设置文档是here。我希望他们能帮助您前进。

关于c++ - WinPCap安装程序出现 “unresolved external symbol”链接器错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14068778/

10-11 20:57