Search code examples
c++objective-cmacoscompatibilitysnmp

OS X libnetsnmp differences between Lion and Snow Leopard


I came across a problem using the SNMP library supplied with Mac OS X (/usr/lib/libnetsnmp.dylib):

  • Version of the library under Snow Leopard is 5.4.2.1
  • Version of the library under Lion is 5.6.1

I use snprint_objid to printout my object's textual representation.

A code compiled under Lion when executed under Snow Leopard gives me a completely different result. For example, a binary compiled and executed under Lion would give me:

IF-MIB::ifDescr.1 ( which is correct and what I need)

the same binary executed under Snow Leopard outputs:

IF-MIB::ifDescr.4296523696

I wonder if someone came across this and knows a work around it.

thank you in advance.


Solution

  • A workaround I came up with is to make my binary to be executed in 32bit mode under 10.6 and in 64bit under 10.7 and above. This resolved the issue.