Bartłomiej Sługocki
Bartłomiej Sługocki

Reputation: 173

How to build libpng using gcc?

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.

Upvotes: 0

Views: 2233

Answers (1)

Glenn Randers-Pehrson
Glenn Randers-Pehrson

Reputation: 12445

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.

Upvotes: 3

Related Questions