I’m currently building SNMP++ using Visual Studio 2019 Professional under Windows 10. The instructions in README.win32 help to a certain extent, so I do the following:
- Download the SNMP++ and VS2013 archives and extract to to the required folders
- Run autoreconf -i
- Run ./configure
- Delete the config_snmp_pp.h from the snmp++\include\snmp_pp folder
- Open the Visual Studio solution and update projects to Windows 10 SDK and VS2019 format
- Fix the include paths in the projects (some are hard-coded to a particular path).
However, I find that the code won’t build unless I make further changes to the SNMP++ source.
snmp++\include\snmp_pp\IPv6Utility.h
I need to comment out the inet_ntop declaration to prevent what appears to be a conflict with Windows 10 SDK:
1>C:\SNMP\snmp++\include\snmp_pp\IPv6Utility.h(68,14): error C2373: 'inet_ntop': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\ws2tcpip.h(593): message : see declaration of 'inet_ntop'
\snmp++\src\usm_v3.cpp
I need to replace “static_cast<pp_int64>” with “SAFE_ULONG_CAST” to fix an unknown identifier:
1>C:\SNMP\snmp++\src\usm_v3.cpp(2768,27): error C2061: syntax error: identifier 'pp_int64'
1>C:\SNMP\snmp++\src\usm_v3.cpp(2769,5): error C2143: syntax error: missing ';' before '{'
1>C:\SNMP\snmp++\src\usm_v3.cpp(2779,5): error C2181: illegal else without matching if
With these two additional changes made, I can build the solution and get the required static library, which can then be used in my application. However, I’m not sure if there should be a cleaner way to do this (maybe via an additional preprocessor definition) instead of editing the source?