I am using winsock.h in a C++ program. I am getting two function errors that can not be resolved. What is wrong?
2015-01-15 13:19:55 UTC
I am programming using winsock. In my program there are two functions, inet_ntop and getaddressinfo. The compile is saying they can not be resolved. What am I missing from my program?
Three answers:
husoski
2015-01-15 13:34:14 UTC
Windows provides a different function for that first operation: InetNtop. The arguments are the same, so you should be able to:
#define inet_ntop InetNtop
...to solve that one.
getaddressinfo should be getaddrinfo, even for Berkely sockets.
?
2015-01-15 15:42:03 UTC
"cannot be resolved" is usually a linker error. Are you including the library (dll) which contains these functions in your build?
?
2015-01-15 13:21:13 UTC
Hmmm.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.