How to build libpng using gcc?

2k views Asked by At

I am currently working on a program that will have to be able to read and save PNG files. I've decided to use libpng so I've downloaded it's source files. I unpacked them and here is where my problem started.

There are very many files in the unpacked folder and I don't know which of them I should compile to get proper.o files that I will be able to link to my program.

1

There are 1 answers

0
Glenn Randers-Pehrson On

There are makefiles in the libpng "scripts" directory. Most of those contain a list of the files that need to be compiled (namely, all of png*.c in the main libpng directory except for pngtest.c).

You'll also need pnglibconf.h which you can create by copying scripts/pnglibconf.h_prebuilt.