cpan: lzma.h not found

0

I just installed Perl on Windows 10 and I am trying to run a script, that requires Compress::Raw::Lzma package installed.

When I run

cpanm Compress::Raw::Lzma 

I got following error:

Lzma.xs:18:19: fatal error: lzma.h: No such file or directory
compilation terminated.
dmake.exe:  Error code 129, while making 'Lzma.o'

How can I miss lzma.h file when I am actually trying to install LZMA? Before this issue, I installed Compress::Raw::Zlib without problems.

Anyway, when I check the debug directory .../.cpanm/work/randomnumber/Compress-Raw-Lzma-2.085, there is indeed Lzma.c file, trying to include lzma.h file, which is, however, not there!

What am I missing?

Larrax

Posted 2019-01-18T14:35:02.403

Reputation: 11

2

See the necessary prerequisites which you'll find in the README: "....you need to have the following installed on your system: ... A copy of liblzma. liblzma is part of the XZ Utils which is available at ...."

– Steffen Ullrich – 2019-01-18T15:13:50.723

The perl module uses the C version of the library. You must have the liblzma C library and its headers installed first. – wazoox – 2019-01-18T17:48:00.797

Thanks for the comments. I must have missed the README. I have tried installing the XZ Utils from sources, I followed the XZ Utils README for Windows Installation. However, the output of the "windows/build.bash" script was an archive, containing the headers. Where should these headers be placed? I tried moving them to PATH directory, but this does not help. I still encounter the "lzma.h" not found error. I am not familiar with installing developer libraries to Windows. A help would be appreciated. Thank you. – Larrax – 2019-01-23T16:23:36.970

I have tried downloading the Compress-Raw-Lzma perl installation archive and changing the config.in file to location of lzma header/lib, instead of /usr/local/include as suggested in README. I have no idea where /usr/local/include is on Windows, but after the change I get other errors, like C:/MinGW/msys/1.0/lib/perl5/5.8/msys/CORE/perl.h:925:27: fatal error: netinet/in.h: No such file or directory – Larrax – 2019-01-23T16:54:19.517

The manual installation mentioned in my last comment was done using msys, so that might trigger the netinet thing. Anyway, how am I supposed to change the INCLUDE and LIB path in config.in when I am installing it in cmd using cpan Compress::Raw::Lzma command, which triggers the error right away? – Larrax – 2019-01-23T17:19:24.437

No answers