Instead of -lpng use:
-L/usr/lib -Wl,-rpath,/usr/lib -lpng12 -lz -lm
How I got to this is:
You can alternativly use:
`libpng-config --ldflags` instead of -lpng12
When I'm too lazy to write a configure and I just make a makefile I use this. It executes the program and uses it's output. Note the ` encasing it.
Many many if not most libraries of this sort have this kind of program.
ls /usr/bin |grep config
To get a list of them, or just use the tab autocomplete to find them.
Seems that you don't need the cflags but for future refenrece you'd need
libpng-config --cflags and libpng-config --ldflags
The former is used when generating object files, .o files, that's the kind of error you had in the first place. The latter is for linking the kind of error you have now.
Last edited by teval; 09-21-2003 at 10:24 AM.