X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: Date: Tue, 2 Oct 2007 23:34:24 +0800 From: valpassing To: cygwin AT cygwin DOT com Subject: Why I cannot build my own program in Cygwin when using libpng function???? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi, 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 AT xiaodwan-wxp ~/Desktop//pix $ gcc -lpng12 -lz -I/usr/include/libpng12 -o ref ref.c /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x37): undefined reference to `_ png_check_sig' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x6b): undefined reference to `_ png_create_read_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c: (.text+0x92): undefined reference to `_ png_create_info_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0xbc): undefined reference to `_ png_destroy_read_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0xf5): undefined reference to `_ png_destroy_read_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x115): undefined reference to ` _png_init_io' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x12a): undefined reference to ` _png_set_sig_bytes' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x140): undefined reference to ` _png_read_info' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x18e): undefined reference to ` _png_get_IHDR' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x1e3): undefined reference to ` _png_destroy_read_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x20d): undefined reference to ` _png_get_valid' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x23a): undefined reference to ` _png_get_bKGD' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x397): undefined reference to ` _png_destroy_read_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x3b9): undefined reference to ` _png_set_palette_to_rgb' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x3d8): undefined reference to ` _png_set_gray_1_2_4_to_8' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x3f6): undefined reference to ` _png_get_valid' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x407): undefined reference to ` _png_set_tRNS_to_alpha' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x41d): undefined reference to ` _png_set_strip_16' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x433): undefined reference to ` _png_set_packing' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x45a): undefined reference to ` _png_set_gray_to_rgb' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x49e): undefined reference to ` _png_set_rgb_to_gray_fixed' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x4b4): undefined reference to ` _png_read_update_info' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x4cd): undefined reference to ` _png_get_rowbytes' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x4ee): undefined reference to ` _png_get_channels' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x52f): undefined reference to ` _png_destroy_read_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x570): undefined reference to ` _png_destroy_read_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x5da): undefined reference to ` _png_read_image' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x601): undefined reference to ` _png_read_end' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x66c): undefined reference to ` _png_destroy_read_struct' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x6d5): undefined reference to ` _display_depth' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x6fa): undefined reference to ` _display_depth' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o:ref.c:(.text+0x709): undefined reference to ` _display_depth' /cygdrive/c/DOCUME~1/xiaodwan/LOCALS~1/Temp/ccsDlvm3.o: ref.c:(.text+0x769): undefined reference to ` _display_graphics' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o):libcmain.c:(.text+0xab): undefine d reference to `_WinMain AT 16' collect2: ld returned 1 exit status I also tried many many other flags in gcc, like -lm,. -lpng, -static, I always got these errors. The same problems exist when I compile my own codes when I using pixbuf library. I want to cry. any one can help me? Thanks so much!!! Xiaodong -- 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/