Search code examples
perlcurlcpan

WWW::Curl installation via CPAN fails with multiple errors


I tried to install WWW::Curl like perl -MCPAN -e 'install WWW::Curl'. During Curl.xs build I get the following errors:

cc -c -I/usr/local/include -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"4.17\" -DXS_VERSION=\"4.17\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.24/mach/CORE" Curl.c In file included from Curl.xs:574:

./curlopt-constants.c:19:58: error:

non-void function 'constant' should return a value [-Wreturn-type] if (strEQ(name, "DID_MEMORY_FUNC_TYPEDEFS")) return CURL_DID_MEMORY_FUNC_TYPEDEFS;

./curlopt-constants.c:136:49: error: use of undeclared identifier

'CURL_STRICTER' if (strEQ(name, "STRICTER")) return CURL_STRICTER;

And a lot of warnings after that.

Is there anything I'm missing?

I tried to build WWW::Curl with perl 5.24.3, on FreeBSD 11.1


Solution

  • There seems to be an open issue in the module repository. It's not closed, but you might want to follow it since there might be a fix in the upcoming releases or in the repo itself. The fix might be

    if ($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z|CURL_DID_MEMORY_FUNC_TYPEDEFS\z)/) {
    

    in line 140 of Makefile.PL