I am trying to compile the extended status module and I am getting a compilation error in file ngx_http_extended_status_module.c
The first sign of trouble is:
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:294: error: ‘ngx_stat_accepted’ undeclared (first use in this function)
The configure command I used is:
./configure --add-module=/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons
which has no problems. Then I ran the make step and it fails with
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail \
-o objs/addon/addons/ngx_http_extended_status_module.o \
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c: In function ‘put_basic_status’:
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:294: error: ‘ngx_stat_accepted’ undeclared (first use in this function)
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:294: error: (Each undeclared identifier is reported only once
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:294: error: for each function it appears in.)
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:295: error: ‘ngx_stat_handled’ undeclared (first use in this function)
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:296: error: ‘ngx_stat_active’ undeclared (first use in this function)
...
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:449: error: ‘SCORE__REQUEST_LEN’ undeclared (first use in this function)
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:467: error: expected expression before ‘)’ token
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:467: error: ‘conns’ undeclared (first use in this function)
make[1]: *** [objs/addon/addons/ngx_http_extended_status_module.o] Error 1
make[1]: Leaving directory `/home/jeff/nginx-1.6.2'
make: *** [build] Error 2
[jeff@247 nginx-1.6.2]$
I did a Google search and found a page that says that I need stub_status to export these identifiers. So I downloaded the source code for 1.6.0 and tried different incantations of the configure command, with no success.
I grepped for ngx_stat_accepted and I found:
[jeff@247 ~]$ grep -r ngx_stat_accepted nginx-1.6.2/* nginx/*
nginx-1.6.2/src/http/modules/ngx_http_stub_status_module.c: ap = *ngx_stat_accepted;
nginx-1.6.2/src/event/ngx_event.h:extern ngx_atomic_t *ngx_stat_accepted;
nginx-1.6.2/src/event/ngx_event.c:ngx_atomic_t ngx_stat_accepted0;
nginx-1.6.2/src/event/ngx_event.c:ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
nginx-1.6.2/src/event/ngx_event.c: size += cl /* ngx_stat_accepted */
nginx-1.6.2/src/event/ngx_event.c: ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
nginx-1.6.2/src/event/ngx_event_accept.c: (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
nginx/nginx-1.6.0/src/http/modules/ngx_http_stub_status_module.c: ap = *ngx_stat_accepted;
nginx/nginx-1.6.0/src/event/ngx_event.h:extern ngx_atomic_t *ngx_stat_accepted;
nginx/nginx-1.6.0/src/event/ngx_event.c:ngx_atomic_t ngx_stat_accepted0;
nginx/nginx-1.6.0/src/event/ngx_event.c:ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
nginx/nginx-1.6.0/src/event/ngx_event.c: size += cl /* ngx_stat_accepted */
nginx/nginx-1.6.0/src/event/ngx_event.c: ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
nginx/nginx-1.6.0/src/event/ngx_event_accept.c: (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: ngx_atomic_t ngx_stat_accepted0;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: size += cl /* ngx_stat_accepted */
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: extern ngx_atomic_t *ngx_stat_accepted;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c: ap = *ngx_stat_accepted;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: ngx_atomic_t ngx_stat_accepted0;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: size += cl /* ngx_stat_accepted */
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: extern ngx_atomic_t *ngx_stat_accepted;
[jeff@247 ~]$
Clearly, I can fix this problem if the C compiler can include the file src/event/ngx_event.h and I think it ought to because the C compiler includes the -I src/event switch, but evidently it isn't happening.
Any ideas?
Many thanks,
Jeff
The first sign of trouble is:
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:294: error: ‘ngx_stat_accepted’ undeclared (first use in this function)
The configure command I used is:
./configure --add-module=/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons
which has no problems. Then I ran the make step and it fails with
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail \
-o objs/addon/addons/ngx_http_extended_status_module.o \
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c: In function ‘put_basic_status’:
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:294: error: ‘ngx_stat_accepted’ undeclared (first use in this function)
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:294: error: (Each undeclared identifier is reported only once
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:294: error: for each function it appears in.)
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:295: error: ‘ngx_stat_handled’ undeclared (first use in this function)
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:296: error: ‘ngx_stat_active’ undeclared (first use in this function)
...
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:449: error: ‘SCORE__REQUEST_LEN’ undeclared (first use in this function)
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:467: error: expected expression before ‘)’ token
/home/jeff/nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c:467: error: ‘conns’ undeclared (first use in this function)
make[1]: *** [objs/addon/addons/ngx_http_extended_status_module.o] Error 1
make[1]: Leaving directory `/home/jeff/nginx-1.6.2'
make: *** [build] Error 2
[jeff@247 nginx-1.6.2]$
I did a Google search and found a page that says that I need stub_status to export these identifiers. So I downloaded the source code for 1.6.0 and tried different incantations of the configure command, with no success.
I grepped for ngx_stat_accepted and I found:
[jeff@247 ~]$ grep -r ngx_stat_accepted nginx-1.6.2/* nginx/*
nginx-1.6.2/src/http/modules/ngx_http_stub_status_module.c: ap = *ngx_stat_accepted;
nginx-1.6.2/src/event/ngx_event.h:extern ngx_atomic_t *ngx_stat_accepted;
nginx-1.6.2/src/event/ngx_event.c:ngx_atomic_t ngx_stat_accepted0;
nginx-1.6.2/src/event/ngx_event.c:ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
nginx-1.6.2/src/event/ngx_event.c: size += cl /* ngx_stat_accepted */
nginx-1.6.2/src/event/ngx_event.c: ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
nginx-1.6.2/src/event/ngx_event_accept.c: (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
nginx/nginx-1.6.0/src/http/modules/ngx_http_stub_status_module.c: ap = *ngx_stat_accepted;
nginx/nginx-1.6.0/src/event/ngx_event.h:extern ngx_atomic_t *ngx_stat_accepted;
nginx/nginx-1.6.0/src/event/ngx_event.c:ngx_atomic_t ngx_stat_accepted0;
nginx/nginx-1.6.0/src/event/ngx_event.c:ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
nginx/nginx-1.6.0/src/event/ngx_event.c: size += cl /* ngx_stat_accepted */
nginx/nginx-1.6.0/src/event/ngx_event.c: ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
nginx/nginx-1.6.0/src/event/ngx_event_accept.c: (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: ngx_atomic_t ngx_stat_accepted0;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: size += cl /* ngx_stat_accepted */
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: extern ngx_atomic_t *ngx_stat_accepted;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-0.8.54.patch: (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
nginx/nginx-1.6.0/ngx_http_extended_status_module/addons/ngx_http_extended_status_module.c: ap = *ngx_stat_accepted;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: ngx_atomic_t ngx_stat_accepted0;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: size += cl /* ngx_stat_accepted */
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
nginx/nginx-1.6.0/ngx_http_extended_status_module/extended_status-1.0.11.patch: extern ngx_atomic_t *ngx_stat_accepted;
[jeff@247 ~]$
Clearly, I can fix this problem if the C compiler can include the file src/event/ngx_event.h and I think it ought to because the C compiler includes the -I src/event switch, but evidently it isn't happening.
Any ideas?
Many thanks,
Jeff