[nginx] hello world module build trouble

Robert Paprocki rpaprocki at fearnothingproductions.net
Fri Dec 12 05:42:10 UTC 2014


I am trying to build a simple nginx module to learn more about nginx's
internals. I have copied several hello world examples into my own
module: http://pastebin.com/esHFtaMw

And the config file: http://pastebin.com/t1fpEPe6

I've downloaded nginx 1.7.8 onto a vanilla Ubuntu 14.04 install. I run
configure with the following:

root at dev:/usr/local/src/nginx-1.7.8# ./configure --with-debug

I see that configure adds it in properly:

[... snip ...]
adding module in /usr/local/src/ngx_hello_dolly
 + ngx_http_hello_dolly was configured
[... snip ...]

But when I run make I receive the following error:

	objs/addon/ngx_hello_dolly/ngx_http_hello_dolly.o \
	objs/ngx_modules.o \
	-lpthread -lcrypt -lpcre -lcrypto -lcrypto -lz
objs/ngx_modules.o:(.data+0x110): undefined reference to
collect2: error: ld returned 1 exit status
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory `/usr/local/src/nginx-1.7.8'
make: *** [build] Error 2

Fule make output is at: http://pastebin.com/DD42e4N9

Can anyone point me in the direction of what I'm doing wrong? I don't
understand why the build process errors out with undefined reference to
`ngx_http_hello_dolly'. Have I mistyped something in my module? I cannot
see any discrepancy between this and something such as
Much appreciated if anyone can point me in the right direction!

More information about the nginx mailing list