mistersquid has asked for the wisdom of the Perl Monks concerning the following question:

tl;dr: I think I need guidance on how to specify <LIBPATH> in

perl Makefile.PL --with-libidn=<LIBPATH> --with-libidn-inc=<INCPATH>

Additional details:

Building Net::LibIDN using

perl Makefile.PL --with-libidn=/usr/local/lib --with-libidn-inc=/usr/local/include

yields the following error

ld: library not found for -lidn clang: error: linker command failed with exit code 1 (use -v to see in +vocation) ld: library not found for -lidn clang: error: linker command failed with exit code 1 (use -v to see in +vocation) This module requires GNU Libidn, which could not be found.

However, I do have GNU Libidn2 installed as follows

/usr/local/lib/libidn2.0.dylib /usr/local/lib/libidn2.a /usr/local/lib/libidn2.dylib /usr/local/lib/libidn2.la /usr/local/include/idna.h -> /usr/local/include/idn2.h /usr/local/include/idn2.h

For context, I ran into the same problem as this StackOverflower except I'm on macOS 10.14 Mojave and was able to make my way past

__test1.c:1:10: fatal error: 'idna.h' file not found #include <idna.h> ^~~~~~~~

by creating the symlink

/usr/local/include/idna.h

which points to

/usr/local/include/idn2.h

Thank you in advance for any pointers.

Replies are listed 'Best First'.
Re: Net::LibIDN and GNU Libidn
by mistersquid (Novice) on Nov 19, 2018 at 21:24 UTC

    After installing GNU libidn 1.35 as follows

    /usr/local/lib/libidn.12.dylib /usr/local/lib/libidn.a /usr/local/lib/libidn.dylib -> libidn.12.dylib /usr/local/lib/libidn.la /usr/local/include/idn-free.h /usr/local/include/idn-int.h /usr/local/include/idna.h /usr/local/include/pr29.h /usr/local/include/punycode.h /usr/local/include/stringprep.h /usr/local/include/tld.h

    I was able to build Net::LibIDN using

    perl Makefile.PL --with-libidn=/usr/local/lib --with-libidn-inc=/usr/local/include

    Note: I installed GNU libidn 1.35 (the version just prior to GNU libidn2) alongside GNU libidn2.