Web lists-archives.org

Re: Why I cannot build my own program in Cygwin when using libpng function????




valpassing wrote:
I installed libpng in cygwin. then I include png.h in my files, and
use many fucntions provided by libpng.
But when I compile it, it reports:

xiaodwan@xiaodwan-wxp ~/Desktop//pix
$ gcc -lpng12 -lz -I/usr/include/libpng12 -o ref ref.c


try

gcc -I/usr/include/libpng12 -o ref ref.c -lpng12 -lz

gcc searches from left to right. If ref.c uses symbols provided by libpng, then libpng must appear *after* ref.c on the command line.

--
Chuck




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/