[AGENT++] compileng with SNMP_PP_IPv6

Nicolai G. utromvecherom at gmail.com
Mon Feb 21 11:05:06 CET 2011


Hello,

While compiling snmp++/agent++ with SNMP_PP_IPv6 I get the following error:
snmp_pp/IPv6Utility.h(72) : error C2373: 'inet_pton' : redefinition;
different type modifiers
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2tcpip.h(579)
: see declaration of 'inet_pton'

in snmp_pp\config_snmp_pp.h I see:
// If IPv6 is enabled assume that inet_pton() is available
// If IPv6 and gcc then assume gethostbyname2() is available
#ifdef SNMP_PP_IPv6
#define HAVE_INET_PTON

so I wrap inet_pton declaration in IPv6Utility.h and definition in
IPv6Utility.cpp
in
#ifndef HAVE_INET_PTON
//...
#endif
construct and it works fine.

Is this is a correct fix?

-- 
Nicolai Grodzitski



More information about the AGENTPP mailing list