免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3795 | 回复: 1
打印 上一主题 下一主题

[Web] Windows 下Apache httpd-2.2.11编译手记 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-18 17:33 |只看该作者 |倒序浏览
平台: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,并安装。
如果提示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,以下图以该目录为例子进行添加:




[ 本帖最后由 ftomorrow 于 2009-3-18 17:35 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2011-03-16 15:47 |只看该作者
哪里下载win32版本的awk???
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP