Page 1 of 1

/libpng.so: undefined reference to.....

Posted: Sun Jan 14, 2007 12:08 pm
by meandi888
Compiling from source on Slackware 10.2 system.

Unpack the source and run 3 times make.
The las time you run make
you get some errors going like this:
(your could be different)
...
.../libpng.so: undefined reference to `deflate'
.../libpng.so: undefined reference to `inflate'
.../libpng.so: undefined reference to `inflateInit_'
.../libpng.so: undefined reference to `crc32'
.../libpng.so: undefined reference to `deflateInit2_'
.../libpng.so: undefined reference to `inflateReset'
.../libpng.so: undefined reference to `deflateReset'
.../libpng.so: undefined reference to `inflateEnd'
.../libpng.so: undefined reference to `deflateEnd'
...

Now open the file Makefile and edit the line
which contains the following:
$(LINK.o) $^ -L/usr/local/lib -lstdc++ -lpng -o $@

Change it now to the following:
$(LINK.o) $^ -L/usr/local/lib -lstdc++ -lpng -lz -o $@

Here we add -lz to link agains the Zlib.
Save and exit.
Run make once again.
Done.

Extras ;)
Save this script in an executable file and run it to have
PNGs from all the files in the input directory.

#!/bin/sh
for i in input/*
do
./cfdg -s 500 $i $i.png
done;

This is what worked for me. Your mileage may vary.
Ragards

Posted: Sun Jan 14, 2007 5:01 pm
by MtnViewJohn
Thanks. I'll put that change in the next release.