Use $CC -E instead of cpp which can't parse system headers. https://rt.cpan.org/Public/Bug/Display.html?id=131089 TODO: If CC is specified on the command line (which it is in MacPorts) use that instead of $Config{cc}. --- Makefile.PL.orig 2021-11-23 11:09:49.000000000 -0600 +++ Makefile.PL 2021-11-23 11:09:24.000000000 -0600 @@ -3,6 +3,7 @@ use lib '.'; use inc::Module::Install; +use Config; name 'WWW-Curl'; abstract 'Perl extension interface for libcurl'; @@ -101,9 +102,10 @@ print "Found curl.h in $curl_h\n"; my @syms; my $has_cpp = 0; - open(H_IN, "-|", "cpp", $curl_h) and $has_cpp++; + my $cc = $Config{cc}; + open(H_IN, "-|", $cc, "-E", $curl_h) and $has_cpp++; unless ($has_cpp) { - warn "No working cpp ($!). Parsing curl.h in Perl"; + warn "No working $cc -E ($!). Parsing curl.h in Perl"; open(H_IN, "<", $curl_h) or die("Can't open curl.h at path $curl_h, because: ".$!); } while ( ) {