title: Linking libbz2.dll under windows (64-bit)
body: <p>I'm trying to use <code>BZ2_bzBuffToBuffDecompress()</code> provided by bzlib.h from bzip.org</p>
  
  <p>My OS is windows 8 64-bit.
  I'm using Dev-C++ 5.6.2 and MingW64.</p>
  
  <p>I created a new C project, included "bzip2-1.0.6/bzlib.h" and added the linker <code>-lbz2</code></p>
  
  <p>Then I built libbz2.dll using Visual studio 2013. </p>
  
  <p>The first time, I built it using the Win32 platform option, witch gave me (while compiling my C program) </p>
  
  <blockquote>
    <p>skipping incompatible .../bzip2-1.0.6/libbz2.dll when searching for
    -lbz2</p>
  </blockquote>
  
  <p>The second time, I built it using the x64 platform option, witch gave me</p>
  
  <blockquote>
    <p>undefined reference to BZ2_bzBuffToBuffDecompress</p>
  </blockquote>
  
  <p>Is there any way to solve this?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried the libraries from Cygwin64 (libbz2.a, libbz2.dll.a, libbz2-2.dll) but each one gave the first error message.</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I ended up using MinGW (32-bit) with libbz2-2.dll</p>