Snmp++ exposes MD5 hash function that collides with other open source library


I post this message because we are interested in using snmp++ however we have a symbol collision issue with other Open Source library like libmhash because SNMP++ exposes the following function.

static void MD5Transform(UINT4 [4], const unsigned char [64]);
static void Encode(unsigned char *, UINT4 *, unsigned int);
static void Decode(UINT4 *, const unsigned char *, unsigned int);
static void MD5_memcpy(POINTER, POINTER, unsigned int);
static void MD5_memset(POINTER, int, unsigned int);

These functions are already defined in other libraries like mhash and cannot be defined twice.

I tried to play around with the configure flags (–enable-namespace) in order to force the usage of namespace but I couldn’t work around it because even if I force the usage of namespace through “SNMP_PP_NAMESPACE” there is a still an

extern “C” {

that exposes these symbol.

Would it be possible to change snmp++ in order to hide these functions inside a namespace (without a << extern “ C” >>)?

Best Regards


yes, this is possible. I will remove the extern “C” declaration for the next release.

Kind Regards,

1 Like

Thank you very much Jochen!