This is the mail archive of the cygwin 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]
Other format: [Raw text]

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


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@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@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/


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