Error building dynamic Module ngx_brotli on Ubuntu 20.04 Raspberry Pi 4

59 Views Asked by At

I am trying to build the Brotli modules on Ubuntu 20.04 on a Raspberry Pi 4. I tried building with the master and the RC1, but em encountering the same errors. Below is the error I am encountering:

sudo make modules
make -f objs/Makefile modules
make[1]: Entering directory '/usr/local/src/nginx-1.25.4'
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -Wno-deprecated-declarations -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I /usr/local/src/ngx_brotli/deps/brotli/c/include -I objs -I src/http -I src/http/modules \
    -o objs/addon/filter/ngx_http_brotli_filter_module.o \
    /usr/local/src/ngx_brotli/filter/ngx_http_brotli_filter_module.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -Wno-deprecated-declarations -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I /usr/local/src/ngx_brotli/deps/brotli/c/include -I objs -I src/http -I src/http/modules \
    -o objs/ngx_http_brotli_filter_module_modules.o \
    objs/ngx_http_brotli_filter_module_modules.c
cc -o objs/ngx_http_brotli_filter_module.so \
objs/addon/filter/ngx_http_brotli_filter_module.o \
objs/ngx_http_brotli_filter_module_modules.o \
-L/usr/local/src/ngx_brotli/deps/brotli/c/../out -lbrotlienc -lbrotlicommon -lm \
-shared
/usr/bin/ld: cannot find -lbrotlienc
/usr/bin/ld: cannot find -lbrotlicommon
collect2: error: ld returned 1 exit status
make[1]: *** [objs/Makefile:1219: objs/ngx_http_brotli_filter_module.so] Error 1
make[1]: Leaving directory '/usr/local/src/nginx-1.25.4'
make: *** [Makefile:16: modules] Error 2

What can I do to build this module dynamically on a raspberry pi4 running Ubuntu Server 20.04?

1

There are 1 best solutions below

0
DanRan On

I needed was missing the dependancy libbrotli-dev. To fix the issue I just did

sudo apt install libbrotli-dev

Then the build worked!