Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building zlib libz.a for 32 bit

Tags:

c++

zlib

mingw

I am trying to compile a 32-bit version (MinGW) of a program I wrote using zlib. Until now, I've never has to compile for 32-bit so the version of zlib I compiled from source (libz.a) is 64-bit. I tried to rerun the makefile in the zlib-1.2.5 directory but it only compiles a 64bit version of libz.a.

I can't seem to find an option to build 32-bit.

Does anyone know how to do this?

Thanks!

Jeffrey Kevin Pry

like image 592
Jeffrey Kevin Pry Avatar asked Jun 29 '11 12:06

Jeffrey Kevin Pry


2 Answers

Checking the configure file, you can see some env.

On 64bit debian, following command line will build the 32bit version of libz

CFLAGS=-m32 ./configure
like image 173
langdead Avatar answered Oct 11 '22 15:10

langdead


It turns out I had to get the 32bit version of MinGW and compile it with that. I was using MinGW64.

like image 25
Jeffrey Kevin Pry Avatar answered Oct 11 '22 17:10

Jeffrey Kevin Pry