Click here to Skip to main content
15,887,338 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi guts,

I am trying to convert from network byte order to host byte order and below is the way have done it.

u_short sport,dport;

MIDL
sport = ntohs(uh->sport);
    dport = ntohs(uh->dport)

;

but i got this link error when i built it.

VB
1>WinPcap_Test.obj : error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function _main
1>dir\Debug\WinPcap_Test.exe : fatal error LNK1120: 1 unresolved external



could anyone help to resolve this problem please.

Many thanks.
Posted

1 solution

Add Ws2_32.lib to your linker modules.
 
Share this answer
 
Comments
Adeji 23-Oct-10 9:07am    
Thanks so much.

it works.

Thanks.
Nish Nishant 23-Oct-10 9:12am    
No problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900