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

Please check here FIRST if you are having difficulties with Context Free. This forum contains answers to the most common questions users have.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
meandi888
Posts: 1
Joined: Sun Jan 14, 2007 9:31 am

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

Post 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

User avatar
MtnViewJohn
Site Admin
Posts: 871
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

Thanks. I'll put that change in the next release.

Post Reply