我在linux redhat服务器上安装Apache httpd-2.4.9,配置命令成功执行,并且在执行make命令时它显示错误为(错误:' apr_OFN_ap_proxy_retry_worker_t'未声明(首次使用)这个功能))。请在下面找到并帮我解决这个问题。
$ make
...
...
apr_OFN_ap_proxy_retry_worker_t' undeclared
make[3]: Entering directory `/install/others/httpd-2.4.9/modules/ssl'
Building shared: mod_ssl.la
make[4]: Entering directory `/install/others/httpd-2.4.9/modules/ssl'
make[4]: Nothing to be done for `local-shared-build'.
make[4]: Leaving directory `/install/others/httpd-2.4.9/modules/ssl'
make[3]: Leaving directory `/install/others/httpd-2.4.9/modules/ssl'
make[3]: Entering directory `/install/others/httpd-2.4.9/modules/proxy/balancers'
Building shared: mod_lbmethod_byrequests.la mod_lbmethod_bytraffic.la mod_lbmethod_bybusyness.la mod_lbmethod_heartbeat.la
make[4]: Entering directory `/install/others/httpd-2.4.9/modules/proxy/balancers'
/install/others/httpd-2.4.9/srclib/apr/libtool --silent --mode=compile gcc -std=gnu99 -g -O2 -pthread -DLINUX -D_REENTRANT -D_GNU_SOURCE -I. -I/install/others/httpd-2.4.9/os/unix -I/install/others/httpd-2.4.9/include -I/install/others/httpd-2.4.9/srclib/apr/include -I/install/others/httpd-2.4.9/srclib/apr-util/include -I/install/others/httpd-2.4.9/srclib/apr-util/xml/expat/lib -I/install/others/apache2/include -I/install/others/httpd-2.4.9/modules/aaa -I/install/others/httpd-2.4.9/modules/cache -I/install/others/httpd-2.4.9/modules/core -I/install/others/httpd-2.4.9/modules/database -I/install/others/httpd-2.4.9/modules/filters -I/install/others/httpd-2.4.9/modules/ldap -I/install/others/httpd-2.4.9/modules/loggers -I/install/others/httpd-2.4.9/modules/lua -I/install/others/httpd-2.4.9/modules/proxy -I/install/others/httpd-2.4.9/modules/session -I/install/others/httpd-2.4.9/modules/ssl -I/install/others/httpd-2.4.9/modules/test -I/install/others/httpd-2.4.9/server -I/install/others/httpd-2.4.9/modules/arch/unix -I/install/others/httpd-2.4.9/modules/dav/main -I/install/others/httpd-2.4.9/modules/generators -I/install/others/httpd-2.4.9/modules/mappers -prefer-pic -c mod_lbmethod_byrequests.c && touch mod_lbmethod_byrequests.slo
mod_lbmethod_byrequests.c: In function 'find_best_byrequests':
<b>mod_lbmethod_byrequests.c:88: error: 'apr_OFN_ap_proxy_retry_worker_t' undeclared (first use in this function)
mod_lbmethod_byrequests.c:88: error: (Each undeclared identifier is reported only once
mod_lbmethod_byrequests.c:88: error: for each function it appears in.)
mod_lbmethod_byrequests.c:88: error: expected expression before ')' token
mod_lbmethod_byrequests.c:95: warning: implicit declaration of function 'APLOGNO'
mod_lbmethod_byrequests.c:96: error: expected ')' before string constant
mod_lbmethod_byrequests.c:97: warning: passing argument 6 of 'ap_log_error' makes pointer from integer without a cast
mod_lbmethod_byrequests.c:112: warning: implicit declaration of function 'PROXY_WORKER_IS_DRAINING'
mod_lbmethod_byrequests.c:142:69: error: invalid digit "8" in octal constant
mod_lbmethod_byrequests.c:143: error: expected ')' before string constant
mod_lbmethod_byrequests.c:144: warning: passing argument 6 of 'ap_log_error' makes pointer from integer without a cast
mod_lbmethod_byrequests.c: At top level:
mod_lbmethod_byrequests.c:177: warning: excess elements in struct initializer
mod_lbmethod_byrequests.c:177: warning: (near initialization for 'byrequests')
mod_lbmethod_byrequests.c:179: warning: excess elements in struct initializer
mod_lbmethod_byrequests.c:179: warning: (near initialization for 'byrequests')
mod_lbmethod_byrequests.c:190: warning: data definition has no type or storage class
mod_lbmethod_byrequests.c:190: warning: type defaults to 'int' in declaration of 'AP_DECLARE_MODULE'
mod_lbmethod_byrequests.c:190: warning: parameter names (without types) in function declaration
mod_lbmethod_byrequests.c:190: error: function 'AP_DECLARE_MODULE' is initialized like a variable
mod_lbmethod_byrequests.c:191: error: invalid initializer
mod_lbmethod_byrequests.c:191: error: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:191: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:191: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:191: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:191: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:191: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:191: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:191: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:191: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:191: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:191: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:191: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:191: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:191: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:191: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:192: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:192: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:193: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:193: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:194: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:194: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:195: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:195: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:196: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:196: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_lbmethod_byrequests.c:198: warning: excess elements in scalar initializer
mod_lbmethod_byrequests.c:198: warning: (near initialization for 'AP_DECLARE_MODULE')
make[4]: *** [mod_lbmethod_byrequests.slo] Error 1</b>
make[4]: Leaving directory `/install/others/httpd-2.4.9/modules/proxy/balancers'
make[3]: *** [shared-build-recursive] Error 1
make[3]: Leaving directory `/install/others/httpd-2.4.9/modules/proxy/balancers'
make[2]: *** [shared-build-recursive] Error 1
make[2]: Leaving directory `/install/others/httpd-2.4.9/modules'
make[1]: *** [shared-build-recursive] Error 1
make[1]: Leaving directory `/install/others/httpd-2.4.9'
make: *** [all-recursive] Error 1
谢谢,
Shanmugam A.
答案 0 :(得分:1)
编译错误:
error: 'apr_OFN_ap_proxy_retry_worker_t' undeclared (first use in this function)
在编译'mod_lbmethod_byrequests.c'时,更具体地说,在编译函数'find_best_byrequests()'时(在'mod_lbmethod_byrequests.c'的第88行);编译器遇到了一个未正确定义的符号'apr_OFN_ap_proxy_retry_worker_t'。
这种类型的错误通常通过包含.h文件来克服,该文件为编译器定义了未知符号('apr_OFN_ap_proxy_retry_worker_t')。
答案 1 :(得分:1)
在尝试安装新的httpd以替换旧的现有httpd时,我也遇到了这个问题。在我的例子中,问题似乎与使用$ HOME / local作为libpcre位置有关,它恰好也包含旧的httpd安装(在$ HOME / local / include中包含旧的头文件)。似乎这些安装的旧头文件在编译新的httpd时遇到了问题。从$ HOME / local / include中删除旧的httpd头文件解决了这个问题。
答案 2 :(得分:0)
我今天遇到了这个问题并且被困了一会儿。我看到了这篇SO文章,并开始查看源代码,试图弄清楚为什么apr_OFN_ap_proxy_retry_worker_t
未声明。我按照apr和apr-util的说明(即将它们下载到srclib中),所以我不明白为什么apr变量是未声明的。好吧,事实证明它是“未声明的”,因为我没有使用--with-included-apr
配置选项。因此,系统正在使用它可以找到的任何相关头文件。而且,由于我在系统上安装了旧的Apache,它在/ usr / include或类似的东西中找到了它。添加--with-included-apr
后,我能够重新配置,制作并成功安装Apache 2.4.10。