Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3A52BD3F.DC615970@ece.gatech.edu> Date: Wed, 03 Jan 2001 00:48:47 -0500 From: Charles Wilson X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: "Jong B. Lee" CC: cygwin Subject: Re: libpng problem -- png_read_destroy References: <002b01c07543$1b93bee0$8b0c4ea8 AT kepri DOT re DOT kr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Two solutions: a) link using 'gcc -static'. You must also define ZLIB_STATIC (see /usr/doc/Cygwin/libpng-x.x.x.README). OR b) DON'T define PNG_STATIC. --Chuck "Jong B. Lee" wrote: > > 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 > > 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 > =============================== -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple