Tagc
Tagc

Reputation: 9072

WinPCap setup giving "unresolved external symbol" linker errors

I'm working with a project made professionally by someone else, so the code should be bug-free. The problems I'm having with it is most likely to do with the project configurations.

The project I'm trying to compile has C and C++ source files kept within the following folders, all within the project directory: Hardware, Header Files, Source Files, TCP/IP, uTasker and WinSim. When I attempt to compile, it returns the following build log:

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 is kept within the Hardware/LPC17XX folder.

WinSim.c and WinSimMain.cpp are kept within the WinSim folder.

I'm not sure how to configure my linker to fix these problems, any help would be appreciated.

Edit: I'm using Visual Studio 2010 to build the project.

Upvotes: 1

Views: 872

Answers (1)

WhozCraig
WhozCraig

Reputation: 66244

The documentation on WinPCap is a little out of date from what I've been able to find, but there are some pretty important setup instructions, particularly the pre-processor macros that should be defined to get things properly setup for a good link.

The latest setup docs I could find are here. I hope they help get you going.

Upvotes: 1

Related Questions