Using the command line and nmake (VC++ 2010 Express)
From Net-SNMP Wiki
Setup the build system
- Download and install Microsoft Visual C++ 2008 Express [1]
- Download and install Microsoft Visual C++ 2010 Express [2]
- Download and install Windows SDK v7.1 [3]
- Download and install ActivePerl v.5.16.3.1604 (x64) for the Make scripts and/or Perl Net-SNMP modules [4]
- Download Net-SNMP v5.7.2.1 ZIP, extract to path without spaces (e.g. C:\projects\net-snmp-5.7.2.1)
Build Net-SNMP
Open a command prompt with the correct options:
- cmd /V:ON /E:ON
Set the environment variables for Visual Studio as well as the SDK (modify paths to match your install locations)
- C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\setenv.cmd /release /x64
Set the install directory variable to what Net-SNMP expects
- SET MSVCDir=%VSINSTALLDIR%
Append the following environment variables to include OpenSSL headers and libraries
- SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.1\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.1\INCLUDE\gl;C:\OpenSSL\include
- SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\X64;C:\OpenSSL\lib\VC
Run the build script
- c:\net-snmp\win32\build.bat
Common Issues
- "This application ahs failed to start because MSVCR80.dll was not found. Re-installing the applcation may fix this problem."
- This error is related to the MS Visual C++ Redistributable Package. Generally you can remedy this issue by runing vcredist_x86.exe (MS Visual C++ Redistributable Package) on the target system.