Search code examples
centosrpmyumidn

idn2.h: No such file or directory


I am on 64-bit Centos 6.6 and want to install libidn2-devel. I tried yum install libidn2-devel and that didn't work. I tried downloading rpms from various websites from Internet(resolving recursive dependencies manually!)

(Not so) Soon I stuck at the one of the dependencies

libidn2.so.0()(64bit) is needed by libidn2-devel-0.10-1.sdl7.x86_64

which I could not find anywhere on the Internet (for CentOS).

Eventually, I downloaded the source and tried to build it.

wget -c ftp://alpha.gnu.org/gnu/libidn/libidn2-0.10.tar.gz
tar -xvzf libidn2-0.10.tar.gz
./configure
make

Success!

However, when I used it to run a module, it gives me

error: idn2.h: No such file or directory
<idn2_variable> was not declared in this scope

PS : RPM seems weird

$ rpm -q libidn2-devel
package libidn2-devel is not installed
$ rpm -q libidn2
libidn2-2.0.4-1.el6.x86_64

Solution

  • libidn2-devel is provided via the EPEL Repo

    Name        : libidn2-devel
    Arch        : x86_64
    Version     : 2.0.4
    Release     : 1.el6
    Size        : 54 k
    Repo        : epel
    Summary     : Development files for libidn2
    URL         : https://www.gnu.org/software/libidn/#libidn2
    License     : (GPLv2+ or LGPLv3+) and GPLv3+
    Description : The libidn2-devel package contains libraries and header files for
                : developing applications that use libidn2.
    

    The wiki page here will give you some more details, and if you want to install EPEL for use with yum then you should download (and install) this rpm to your system then check in /etc/yum.repos.d/epel.repo for the config file it will leave. Inside there you need to check the [EPEL] section has the line enabled=1 (I think its disabled by default)

    You may want/need to clean up the stuff you have tried to manually install though so you avoid any problems with updates etc.