I'm trying compile nginx ... configure seems ok, then when I type make I get following error:

make -f objs/Makefile
make[1]: Entering directory '/home/paul/src/ngxbuild/nginx-1.14.0'
cc -o objs/ngx_http_perl_module.so \
objs/src/http/modules/perl/ngx_http_perl_module.o \
objs/ngx_http_perl_module_modules.o \
-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lc -lcrypt \
/usr/bin/x86_64-linux-gnu-ld: cannot find -lperl
collect2: error: ld returned 1 exit status
objs/Makefile:1670: recipe for target 'objs/ngx_http_perl_module.so' failed
make[1]: *** [objs/ngx_http_perl_module.so] Error 1
make[1]: Leaving directory '/home/paul/src/ngxbuild/nginx-1.14.0'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

so error is cannot find -lperl

well the problem seems that in /usr/lib/x86_64-linux-gnu/perl/5.26/ there's no CORE directory. I use Ubuntu server 18.0, update and upgraded, an I can't find the way to update...

Debian stretch contain perl 5.24.1 and CORE directory exist in /usr/lib/x86_64-linux-gnu/perl/5.24/, so why ubuntu won't install core directory and how install it


The Can not find -lperl error means it can not find libperl.

On Debian Stretch this is provided by libperl-dev

% apt-file list libperl-dev
libperl-dev: /usr/lib/x86_64-linux-gnu/libperl.a
libperl-dev: /usr/lib/x86_64-linux-gnu/libperl.so
libperl-dev: /usr/share/doc/libperl-dev/README.cross
libperl-dev: /usr/share/doc/libperl-dev/changelog.Debian.gz
libperl-dev: /usr/share/doc/libperl-dev/copyright

I would expect a similar package to be needed on Ubuntu.

  • yes apt install libperl-dev solve errors, @ S.Harris about -lperl error look at the line "/usr/bin/x86_64-linux-gnu-ld: cannot find -lperl" it's the 7 starting from the buttom – LXG Jun 2 '18 at 11:53
  • The command option -lperl means "link in the perl library". The error message says it couldn't find the relevant libperl file. – Stephen Harris Jun 2 '18 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.