Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPAN install error on OS X #67

Open
p4paul opened this issue Jul 16, 2022 · 1 comment
Open

CPAN install error on OS X #67

p4paul opened this issue Jul 16, 2022 · 1 comment

Comments

@p4paul
Copy link

p4paul commented Jul 16, 2022

I am unable to install Net::Curl::Easy on MacOS Monterey 12.4
I'm using brew:

$ which perl
/usr/local/bin/perl

This is perl 5, version 34, subversion 0 (v5.34.0) built for darwin-thread-multi-2level

------------[snip]-------->8---

/usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
./const-easy-xs.inc:824:35: error: use of undeclared identifier 'CURL_PREREQFUNC_ABORT'
                        { "CURL_PREREQFUNC_ABORT", 21, CURL_PREREQFUNC_ABORT },
                                                       ^
./const-defenums-h.inc:2735:32: note: expanded from macro 'CURL_PREREQFUNC_ABORT'
# define CURL_PREREQFUNC_ABORT CURL_PREREQFUNC_ABORT
                               ^
./const-easy-xs.inc:825:32: error: use of undeclared identifier 'CURL_PREREQFUNC_OK'
                        { "CURL_PREREQFUNC_OK", 18, CURL_PREREQFUNC_OK },
                                                    ^
./const-defenums-h.inc:2738:29: note: expanded from macro 'CURL_PREREQFUNC_OK'
# define CURL_PREREQFUNC_OK CURL_PREREQFUNC_OK
                            ^
478 warnings and 2 errors generated.
make: *** [Curl.o] Error 1
  SYP/Net-Curl-0.51.tar.gz
  /usr/bin/make -- NOT OK
Failed during this command:
 SYP/Net-Curl-0.51.tar.gz                     : make NO

cpan[2]>        

This has been working, but after upgrading to Monterey I can't install (other CPAN models seem ok)

Please let me know if you need the full log.

Kind regards,
Paul

@creaktive
Copy link
Collaborator

creaktive commented Aug 7, 2022

Sorry for the delay... What is the output of perl Makerfile.PL? I recall having similar issues when compiling with the libcurl version shipped with MacOS. Long story short: it is mangled; better use the version from Homebrew. The caveat is that you have to set environment variables to point the compiler to the Homebrew's libcurl version. This should do the trick:

brew install curl
eval $( brew shellenv )
export LDFLAGS="-L$HOMEBREW_PREFIX/opt/curl/lib"
export CPPFLAGS="-I$HOMEBREW_PREFIX/opt/curl/include"
export PKG_CONFIG_PATH="$HOMEBREW_PREFIX/opt/curl/lib/pkgconfig"
perl Makefile.PL
make
make test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants