This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libpng problem -- png_read_destroy


Happy New Year !!

I'm writing a program using png library.

But, gcc complains that   png_read_destroy  and  png_write_destroy  are  undefined.

How can I fix it?

I have the latest and clean cygwin installed.

Here's a sample c file and link error :

------------------------------------
/* sample   png.c */
#include <png.h>

int main()
{
   #ifdef __CYGWIN__
   #define PNG_STATIC
   #endif

   png_structp pp;
   png_infop info;
   png_read_end(pp, info);
   png_read_destroy(pp, info, NULL);
   png_write_destroy (pp);
   
   return 0;
}
-------------------------------------
$ gcc -W -g png.c  -lpng  -o png

/c/WINDOWS/TEMP/ccFXASfF.o(.text+0x30): undefined reference to `png_read_destroy'
/c/WINDOWS/TEMP/ccFXASfF.o(.text+0x3f): undefined reference to `png_write_destroy'
collect2: ld returned 1 exit status
===============================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]