Windows 下Apache httpd-2.2.11编译手记 (转)

平台:windows XP
编译工具:Microsoft VC6.0
源码下载:http://apache.mirror.phpchina.com/httpd/
下载版本:httpd-2.2.11-win32-src-r2.zip     06-Jan-2009 02:55  9.6M  HTTP Server project
1) 下载源码后解压,使用VC打开Apache.dsw文件,设置BuildBin classess 工程为Active。
2)开始编译,在编译中VC可能会提示错误。
3)如果编译提示没有找到strings.h和inet.h 错误:

D:/httpd-2.2.11/srclib/apr/include/apr_want.h(52): Could not find the file strings.h
D:/httpd-2.2.11/srclib/apr/include/apr_want.h(121): Could not find the file arpa/inet.h  

   打开httpd-2.2.11/srclib/apr/include/apr_want.h 文件,把以下行注释掉:

#if APR_HAVE_STRINGS_H
#include <strings.h>
#endif


#if APR_HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif


4) 如果编译时候提示不支持 LDAP v2.0错误:

apr_ldap_stub.c
./include/apr_ldap.h(132) : fatal error C1189: #error :  Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
apr_ldap_url.c
apr_ldap_url.c
./include/apr_ldap.h(132) : fatal error C1189: #error :  Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
Generating Code...

    打开httpd-2.2.11/srclib/apr-util/include/apr_ldap.h 文件,注释该行代码:

#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.

5) 如果出现identifier 'SQLLEN' 错误:

D:httpd-2.2.11/srclib/apr-util/dbd/apr_dbd_odbc.c(134) : error C2061: syntax error : identifier 'SQLLEN'

    打开文件:httpd-2.2.11/srclib/apr-util/dbd/apr_dbd_odbc.c,在文件头部添加以下行:

typedef INT32 SQLLEN;

6) 如果出现LDAP_VENDOR_NAME 错误:

D:/httpd-2.2.11/srclib/apr-util/ldap/apr_ldap_init.c(194) : error C2146: syntax error : missing ';' before identifier 'LDAP_VENDOR_NAME'
D:/httpd-2.2.11/srclib/apr-util/ldap/apr_ldap_init.c(195) : error C2065: 'LDAP_VENDOR_NAME' : undeclared identifier
D:/httpd-2.2.11/srclib/apr-util/ldap/apr_ldap_init.c(195) : error C2143: syntax error : missing ';' before 'string'

   打开httpd-2.2.11/srclib/apr-util/ldap/apr_ldap_init.c 文件,注释以下行:

LDAP_VENDOR_NAME

7) 如果出现WtsApi32.h没有包含错误:

D:/httpd-2.2.11/support/win32/ApacheMonitor.c(45) : fatal error C1083: Cannot open include file: WtsApi32.h': No such file or directory

   该提示表示没有安装或配置Microsoft 的PlatformSDK,需要去微软网站上下载PlatformSDK,并安装。
8) 如果提示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
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值