diff --git a/Net/src/IPAddress.cpp b/Net/src/IPAddress.cpp index 1f7b7945d..69dc5ab3f 100644 --- a/Net/src/IPAddress.cpp +++ b/Net/src/IPAddress.cpp @@ -44,10 +44,14 @@ namespace Poco { namespace Net { +#if !defined(_MSC_VER) || defined(__STDC__) +// Go home MSVC, you're drunk... +// See http://stackoverflow.com/questions/5899857/multiple-definition-error-for-static-const-class-members const IPAddress::Family IPAddress::IPv4; #if defined(POCO_HAVE_IPv6) const IPAddress::Family IPAddress::IPv6; #endif +#endif IPAddress::IPAddress() diff --git a/Net/src/SocketAddress.cpp b/Net/src/SocketAddress.cpp index 72520be09..675edf319 100644 --- a/Net/src/SocketAddress.cpp +++ b/Net/src/SocketAddress.cpp @@ -58,6 +58,9 @@ struct AFLT // +#if !defined(_MSC_VER) || defined(__STDC__) +// Go home MSVC, you're drunk... +// See http://stackoverflow.com/questions/5899857/multiple-definition-error-for-static-const-class-members const SocketAddress::Family SocketAddress::IPv4; #if defined(POCO_HAVE_IPv6) const SocketAddress::Family SocketAddress::IPv6; @@ -65,6 +68,7 @@ const SocketAddress::Family SocketAddress::IPv6; #if defined(POCO_OS_FAMILY_UNIX) const SocketAddress::Family SocketAddress::UNIX_LOCAL; #endif +#endif SocketAddress::SocketAddress()