Hello world module build trouble

Hello,

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: /* * ngx_http_hello_dolly.c */#include <ngx_config.h>#include <ngx_cor - Pastebin.com

And the config file: ngx_addon_name=ngx_http_hello_dollyHTTP_MODULES="$HTTP_MODULES ngx_http_hello_ - Pastebin.com

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

root@dev:/usr/local/src/nginx-1.7.8# ./configure --with-debug
–add-module=/usr/local/src/ngx_hello_dolly

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
ngx_http_hello_dolly' 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: root@dev:/usr/local/src/nginx-1.7.8# make -j8make -f objs/Makefilemake[1]: E - Pastebin.com

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
(ZhuZhaoyuan.com is for sale | HugeDomains).
Much appreciated if anyone can point me in the right direction!

Hello.

Why don’t you apply a difference below?

— config.orig 2014-12-12 16:10:06.000000000 +0900
+++ config 2014-12-12 16:06:19.000000000 +0900
@@ -1,3 +1,3 @@
-ngx_addon_name=ngx_http_hello_dolly
-HTTP_MODULES=“$HTTP_MODULES ngx_http_hello_dolly”
+ngx_addon_name=ngx_http_hello_dolly_module
+HTTP_MODULES=“$HTTP_MODULES ngx_http_hello_dolly_module”
NGX_ADDON_SRCS=“$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_hello_dolly.c”

Posted at Nginx Forum:

Yep, I didn’t realize the _module suffix was required. It built
successfully, thank you!