windows下编译使用Net-SNMP.doc
文本预览下载声明
说明:
根据net-snmp-5.6中的“README.win32”摘录和翻译。转载请注明出处。
email:wulinshuxue@
net-snmp 在windows下用MSVC编译(一)
net-snmp是一个开源项目,提供关于snmp的一些库和工具。下载网址:
/projects/net-snmp/
目前的最新版本是5.6。如果想简单地安装一下的话,可以下载x86的exe版本,一般最新版的程序还没有发布exe版本。目前最新的exe版本为net-snmp-5.5.0-1.x86.exe 。
在网上搜了一下,大多是在linux下的编译过程,windows下的情况比较少,另外,一些注意事项也很少。
?
在下载了net-snmp-5.6后,看到里面那么多的文件,觉得很晕。我猜里面需要先读的文件大概是“win32.readme”,这个文件是在win32环境下编译使用net-snmp的说明文件。
用记事本打开后,估计超长的篇幅要让不少人崩溃。不过没事,这是分小节写的,每小节有内容说明,条理很清晰。
摘录了一些说明,并作了大致的翻译,如下:
1、“This guide describes building with Microsoft Visual C++ 6.0 and higher, withthe gcc compiler from MinGW / MSYS, and with the gcc compiler from Cygwin.As developers build with other Win32 environments, their notes will be included here.”
这个指南介绍了如何使用VC++6.0及更高版本以及gcc来build。
2、If you are using Microsoft Visual Studio 6.0, you will have to install thePlatform SDK (PSDK) first.
如果使用的是VC6.0,那么必须先安装PSDK
3、If you are using any of the following environments, the PSDK download is notnecessary as the required parts of the PSDK are included:??? - Microsoft Visual Studio 2002 or later.??? - Cygwin.??? - MinGW.
使用的是这些环境的话,无需安装PSDK
4、There are two ways to build Net-SNMP using Microsoft Visual C++.? The firstand easiest method is using Configure and nmake on the command line, and the second is using the Workspace files inside the interactive developmentenvironment.
两种方式来用VC build Net-SNMP.
第一种,也是最简单的方法,就是在命令行下使用Configure和nmake。
第二种,就是IDE下使用workspace文件。
4.1、To use nmake on the command line, the Configure script is run first to createthe various makefiles.? Once these have been created, nmake is used to buildthe applications.? Perl is required to use this method, as the Configurescript is written in Perl.? ActiveState ActivePerl is available at:
??????? /Products/ActivePerl/
为了在命令行下使用nmake,必须先运行Configure脚本来生成makefile。由于Configure脚本是
用Perl写的,所以要先安装ActivePerl
4.2、The make file system is based on and uses the directory structure of the projects contained in the Workspace files which are described below.?
显示全部