Compiling a program on Linux with MinGW for Windows


I just tried to compile a program with MinGW. This usually works fine, but this time I needed some functions for data compression. Therefore I tried the option “-lz” (for zlib). After this, I got error message that the compile did not find the appropriate header files.

Does anybody know what to do?

Hello again!
Now, the compiler finds the include file “zlib.h” (I had to copy it into /usr/i586-mingw32msvc/include).
But, unfortunately, I get the message:

/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/…/…/…/…/i586-mingw32msvc/bin/ld: cannot find -lz

Any ideas?