bzip2 [ Home | Documentation | Downloads ]
3.8. Making a Windows DLL

3.8. Making a Windows DLL

Everything related to Windows has been contributed by Yoshioka Tsuneo (QWF00133@niftyserve.or.jp / tsuneo-y@is.aist-nara.ac.jp), so you should send your queries to him (but perhaps Cc: me, jseward@bzip.org).

My vague understanding of what to do is: using Visual C++ 5.0, open the project file libbz2.dsp, and build. That's all.

If you can't open the project file for some reason, make a new one, naming these files: blocksort.c, bzlib.c, compress.c, crctable.c, decompress.c, huffman.c, randtable.c and libbz2.def. You will also need to name the header files bzlib.h and bzlib_private.h.

If you don't use VC++, you may need to define the proprocessor symbol _WIN32.

Finally, dlltest.c is a sample program using the DLL. It has a project file, dlltest.dsp.

If you just want a makefile for Visual C, have a look at makefile.msc.

Be aware that if you compile bzip2 itself on Win32, you must set BZ_UNIX to 0 and BZ_LCCWIN32 to 1, in the file bzip2.c, before compiling. Otherwise the resulting binary won't work correctly.

I haven't tried any of this stuff myself, but it all looks plausible.


Copyright © 1996 - 2008  julian@bzip.org