Rayne
2009-12-08 03:56:20 UTC
Hi all,
I'm trying to implement the inet_ntop function in Windows, and I found
the code from http://www.mail-archive.com/***@ipv6.org/msg02107.html
I'm using Visual Studio .NET 2003, and according to the msdn article
for getnameinfo(), I need to include the Ws2tcpip.h file and also
include the Wspiapi.h file. So in my header file, I have
#include <Ws2tcpip.h>
#include <Wspiapi.h>
#include <string.h>
and the function definition is in a .c file. Ws232.lib is also
specified in my Project properties -> Configuration Properties ->
Linker -> Input -> Additional Dependencies.
However, I have the following errors (several instances of each error
shown below, and several other similar ones) and they all point to the
Ws2tcpip.h file.
error C2039: 'Byte' : is not a member of 'in6_addr::__unnamed'
error C2039: 'sin6_flowinfo' : is not a member of 'sockaddr_in6'
error C2039: 'sin6_port' : is not a member of 'sockaddr_in6'
error C2039: 'sin6_scope_id' : is not a member of 'sockaddr_in6'
error C2039: 'Word' : is not a member of 'in6_addr::__unnamed'
error C2065: 'AF_INET6' : undeclared identifier
error C2079: 'ip_mreq::imr_interface' uses undefined struct 'in_addr'
error C2079: 'ip_msfilter::imr_interface' uses undefined struct
'in_addr'
error C2079: 'sockaddr_gen::Address' uses undefined struct 'sockaddr'
error C2079: 'sockaddr_gen::AddressIn' uses undefined struct
'sockaddr_in'
error C2371: 'FAR' : redefinition; different basic types
error C2501: 'in6_addr::__unnamed::Byte' : missing storage-class or
type specifiers
error C3861: 'AF_INET6': identifier not found, even with argument-
dependent lookup
error C3861: 'memcmp': identifier not found, even with argument-
dependent lookup
error C3861: 'memset': identifier not found, even with argument-
dependent lookup
I've tried including <Windows.h> and switching the order of
<Ws2tcpip.h> and <Wspiapi.h>, but I still get the errors. Why is this
so?
Thank you.
Regards,
Rayne
I'm trying to implement the inet_ntop function in Windows, and I found
the code from http://www.mail-archive.com/***@ipv6.org/msg02107.html
I'm using Visual Studio .NET 2003, and according to the msdn article
for getnameinfo(), I need to include the Ws2tcpip.h file and also
include the Wspiapi.h file. So in my header file, I have
#include <Ws2tcpip.h>
#include <Wspiapi.h>
#include <string.h>
and the function definition is in a .c file. Ws232.lib is also
specified in my Project properties -> Configuration Properties ->
Linker -> Input -> Additional Dependencies.
However, I have the following errors (several instances of each error
shown below, and several other similar ones) and they all point to the
Ws2tcpip.h file.
error C2039: 'Byte' : is not a member of 'in6_addr::__unnamed'
error C2039: 'sin6_flowinfo' : is not a member of 'sockaddr_in6'
error C2039: 'sin6_port' : is not a member of 'sockaddr_in6'
error C2039: 'sin6_scope_id' : is not a member of 'sockaddr_in6'
error C2039: 'Word' : is not a member of 'in6_addr::__unnamed'
error C2065: 'AF_INET6' : undeclared identifier
error C2079: 'ip_mreq::imr_interface' uses undefined struct 'in_addr'
error C2079: 'ip_msfilter::imr_interface' uses undefined struct
'in_addr'
error C2079: 'sockaddr_gen::Address' uses undefined struct 'sockaddr'
error C2079: 'sockaddr_gen::AddressIn' uses undefined struct
'sockaddr_in'
error C2371: 'FAR' : redefinition; different basic types
error C2501: 'in6_addr::__unnamed::Byte' : missing storage-class or
type specifiers
error C3861: 'AF_INET6': identifier not found, even with argument-
dependent lookup
error C3861: 'memcmp': identifier not found, even with argument-
dependent lookup
error C3861: 'memset': identifier not found, even with argument-
dependent lookup
I've tried including <Windows.h> and switching the order of
<Ws2tcpip.h> and <Wspiapi.h>, but I still get the errors. Why is this
so?
Thank you.
Regards,
Rayne