0

Cannot find BZIP2 library on Cygwin 64 on Win7(64).

I am using CYGWIN64 on Win 64. I can use bzip2 from the terminal but unable to locate the header file to use bzip2 programatically from an ANSI C application.

I went to the BZIP site and downloaded the 1.0.6 tarball which i gunzipped and untared.

Should i move the bzip2-1.0.6 folder under cygwin64/lib and compile it?

Can anyone advice on specific next steps to invoke bzip2?

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • 1
    Cygwin installs packages via setup program (if I remember right). Rerun setup and select libbz2-devel or something like this. Alternatively download devel package and unzip to your app, bz2 has just 1 header, include it from your app and compile, should work. Try [this package](https://cygwin.com/cygwin/packages/x86_64/libbz2-devel/libbz2-devel-1.0.6-2) – Uprooted Feb 06 '18 at 00:14

1 Answers1

0

The header is bzlib.h To find the package that contains it, use cygcheck:

$ cygcheck -p include/bzlib.h
Found 6 matches for include/bzlib.h
libbz2-devel-1.0.6-2 - libbz2-devel: BZip file de/compressor (installed binaries and support files)
libbz2-devel-1.0.6-3 - libbz2-devel: BZip file de/compressor
mingw64-i686-bzip2-1.0.6-3 - mingw64-i686-bzip2: libbz2 for MinGW-w64 Win32 toolchain (installed binaries and support files)
...

So you need to install libbz2-devel as already explained to you by @user7231

matzeri
  • 8,062
  • 2
  • 15
  • 16
  • ok - I ran cygcheck -p include/bzlib.h and got the exact same results as you did, although #include or #include "bzlib.h" results in a compilation error - No such file or directory - maybe a path problem? – user9200348 Feb 06 '18 at 11:13
  • To clarify - based on cygcheck's output the it appears that libbz2-devel is installed. Please correct me if i am wrong. – user9200348 Feb 06 '18 at 13:12
  • PROBLEM SOLVED - installing libbz2-devel and using the proper linker command did the trick. Thank you both! This thread is closed. – user9200348 Feb 06 '18 at 13:57