Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile fail #11

Open
WinterChen opened this issue May 5, 2019 · 7 comments
Open

compile fail #11

WinterChen opened this issue May 5, 2019 · 7 comments

Comments

@WinterChen
Copy link

WinterChen commented May 5, 2019

When I build the stream-echo-nginx-module, Complitation failed with the errors as flow,
ngx_stream_echo_module.c:1146:9: 错误:隐式声明函数‘ngx_stream_close_connection [-Werror=implicit-function-declaration] ngx_stream_close_connection(c);
my gcc version is 4.8.5。
My nginx version is 1.15.9。

@WinterChen
Copy link
Author

I read the code carefully, the function ngx_stream_close_connection is static defined in ngx_stream_handler.c,
static void ngx_stream_close_connection(ngx_connection_t *c);
it can not be used externally. I replace ngx_stream_close_connection whit ngx_stream_finalize_session, and complile successfully.
I think ngx_stream_close_connection maybe not static in the old verison of nginx

@agentzh
Copy link
Member

agentzh commented May 5, 2019

@WinterChen Will you please create a github pull request for this fix? Many thanks. Not sure if we still want to support older versions of the nginx core. Maybe we could simply drop the support for older nginx versions.

@vndroid
Copy link

vndroid commented Dec 13, 2019

In fact, On the Alpine 3.10, Nginx 1.17.6 have same issues.

@vndroid
Copy link

vndroid commented Dec 13, 2019

Such as:

/usr/src/stream-echo-nginx-module/src/ngx_stream_echo_module.c: In function 'ngx_stream_echo_discarded_request_handler':
/usr/src/stream-echo-nginx-module/src/ngx_stream_echo_module.c:1146:9: error: implicit declaration of function 'ngx_stream_close_connection'; did you mean 'ngx_stream_init_connection'? [-Werror=implicit-function-declaration]
         ngx_stream_close_connection(c);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
         ngx_stream_init_connection

and

cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:1824: objs/addon/src/ngx_stream_echo_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/usr/src/nginx-1.17.6'
make: *** [Makefile:8: build] Error 2

@GongT
Copy link

GongT commented Jan 25, 2020

Fedora 31 with newest master branch from https://github.com/nginx/nginx (master)

/usr/bin/ld: objs/addon/src/ngx_stream_echo_module.o: in function `ngx_stream_echo_lingering_close_handler':
/opt/source/nginx/../modules/stream-echo-nginx-module//src/ngx_stream_echo_module.c:1564: undefined reference to `ngx_stream_close_connection'
/usr/bin/ld: objs/addon/src/ngx_stream_echo_module.o: in function `ngx_stream_echo_finalize':
/opt/source/nginx/../modules/stream-echo-nginx-module//src/ngx_stream_echo_module.c:1455: undefined reference to `ngx_stream_close_connection'
/usr/bin/ld: objs/addon/src/ngx_stream_echo_module.o: in function `ngx_stream_echo_discarded_request_handler':
/opt/source/nginx/../modules/stream-echo-nginx-module//src/ngx_stream_echo_module.c:1146: undefined reference to `ngx_stream_close_connection'
collect2: error: ld returned 1 exit status

@agentzh
Copy link
Member

agentzh commented Jan 28, 2020

Pull requests welcome. We no longer actively develop this module ourselves but we welcome patches from the community. Thanks.

@dpvmw
Copy link

dpvmw commented Oct 21, 2020

we are still seeing this issue @agentzh , did this issue got fixed in any pull request
../stream-echo-nginx-module/src/ngx_stream_echo_module.c: In function ‘ngx_stream_echo_discarded_request_handler’:
../stream-echo-nginx-module/src/ngx_stream_echo_module.c:1146:9: error: implicit declaration of function ‘ngx_stream_close_connection’; did you mean ‘ngx_stream_init_connection’? [-Werror=implicit-function-declaration]
ngx_stream_close_connection(c);

@WinterChen do u have the pull request for this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants