Windows 下Apache httpd-2.0.63编译手记
时间:2009-04-01 来源:ftomorrow
平台:windows XP
编译工具:Microsoft VC6.0
源码下载:http://apache.mirror.phpchina.com/httpd/
下载版本:httpd-2.0.63-win32-src.zip 19-Jan-2008 09:29 7.9M HTTP Server project
1) 下载源码后解压,使用VC打开Apache.dsw文件,设置BuildBin classess 工程为Active。
2)开始编译,在编译中VC可能会提示错误。
3)如果编译提示没有找到strings.h和inet.h错误:
编译工具:Microsoft VC6.0
源码下载:http://apache.mirror.phpchina.com/httpd/
下载版本:httpd-2.0.63-win32-src.zip 19-Jan-2008 09:29 7.9M HTTP Server project
1) 下载源码后解压,使用VC打开Apache.dsw文件,设置BuildBin classess 工程为Active。
2)开始编译,在编译中VC可能会提示错误。
3)如果编译提示没有找到strings.h和inet.h错误:
D:\httpd-2.0.63\srclib\apr\include\apr_want.h(52): Could not find the file strings.h.
D:\httpd-2.0.63\srclib\apr\include\apr_want.h(85): Could not find the file sys/uio.h.
D:\httpd-2.0.63\srclib\apr\include\apr_want.h(103): Could not find the file arpa/inet.h.
可以打开httpd-2.0.63\srclib\apr\include\apr_want.h 文件,把以下行注释掉:
D:\httpd-2.0.63\srclib\apr\include\apr_want.h(85): Could not find the file sys/uio.h.
D:\httpd-2.0.63\srclib\apr\include\apr_want.h(103): Could not find the file arpa/inet.h.
可以打开httpd-2.0.63\srclib\apr\include\apr_want.h 文件,把以下行注释掉:
#if APR_HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#include <arpa/inet.h>
#endif
#if APR_HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
#include <sys/uio.h>
#endif
#if APR_HAVE_STRINGS_H
#include <strings.h>
#endif
4) 如果编译时候提示HCRYPTPROV错误:
#include <strings.h>
#endif
4) 如果编译时候提示HCRYPTPROV错误:
D:\httpd-2.0.63\srclib\apr\misc\win32\rand.c(33) : error C2065: 'HCRYPTPROV' : undeclared identifier
打开D:\httpd-2.0.63\srclib\apr\misc\win32\Rand.c 文件,在文件头部添加一行:
打开D:\httpd-2.0.63\srclib\apr\misc\win32\Rand.c 文件,在文件头部添加一行:
#define _WIN32_WINNT 0x0500
5) 如果编译时提示awk 错误:
5) 如果编译时提示awk 错误:
'awk' 不是内部或外部命令,也不是可运行的程序或批处理文件。
Error executing c:\windows\system32\cmd.exe.
这个错误是由于没有安装awk工具导致,可以先到http://www.gnu.org/software/gawk/ 下载一个gawk进行安装。如果安装的目录为:C:\Program Files\GnuWin32,在该目录下可以看到一个bin目录,需要把该目录添加到VC Executable files。我的bin目录完整路径为:C:\Program Files\GnuWin32\bin,以下图以该目录为例子进行添加:
0 && image.height>0){if(image.width>=700){this.width=700;this.height=image.height*700/image.width;}}" src="http://photo16.hexun.com/p/2009/0311/304816/b_5CD6E9B03B1A0C5EBD64C42040A988F0.jpg" alt="查看更多精彩图片" border="0">
0 && image.height>0){if(image.width>=700){this.width=700;this.height=image.height*700/image.width;}}" src="http://photo16.hexun.com/p/2009/0311/304816/b_029264A1BF560A13E5700C6784BC79A4.jpg" alt="查看更多精彩图片" border="0">
0 && image.height>0){if(image.width>=700){this.width=700;this.height=image.height*700/image.width;}}" src="http://photo16.hexun.com/p/2009/0311/304816/b_92CAC6AC57779723DC6892066DCC924E.jpg" alt="查看更多精彩图片" border="0">
Error executing c:\windows\system32\cmd.exe.
这个错误是由于没有安装awk工具导致,可以先到http://www.gnu.org/software/gawk/ 下载一个gawk进行安装。如果安装的目录为:C:\Program Files\GnuWin32,在该目录下可以看到一个bin目录,需要把该目录添加到VC Executable files。我的bin目录完整路径为:C:\Program Files\GnuWin32\bin,以下图以该目录为例子进行添加:
相关阅读 更多 +