png-text-embed icon indicating copy to clipboard operation
png-text-embed copied to clipboard

Build fails

Open ripper17 opened this issue 8 years ago • 1 comments

When trying to build this on Kubuntu 14.04 (LTS) I'm getting the following error:

$ make
cc `pkg-config --cflags libpng` -g   -c -o png-text-append.o png-text-append.c
cc `pkg-config --cflags libpng` -g   -c -o crc.o crc.c
cc -opng-text-append png-text-append.o crc.o
cc `pkg-config --cflags libpng` -g   -c -o png-text-dump.o png-text-dump.c
cc `pkg-config --libs libpng` -opng-text-dump png-text-dump.o
png-text-dump.o: In function `main':
/leo/office/martin/git/png-text-embed/png-text-dump.c:18: undefined reference to `png_create_read_struct'
/leo/office/martin/git/png-text-embed/png-text-dump.c:21: undefined reference to `png_create_info_struct'
/leo/office/martin/git/png-text-embed/png-text-dump.c:22: undefined reference to `png_create_info_struct'
/leo/office/martin/git/png-text-embed/png-text-dump.c:24: undefined reference to `png_init_io'
/leo/office/martin/git/png-text-embed/png-text-dump.c:25: undefined reference to `png_read_png'
/leo/office/martin/git/png-text-embed/png-text-dump.c:29: undefined reference to `png_get_text'
collect2: error: ld returned 1 exit status
make: *** [png-text-dump] Error 1

GCC used: $ gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4

ripper17 avatar Mar 22 '16 10:03 ripper17

To compile ( -Wall gives a warning) : gcc png-text-append.c crc.c -o png-text-append // without png library

gcc png-text-dump.c -L/usr/local/lib -lpng -o png-text-dump // with png library

to use :

./png-text-dump r.png

adammaj1 avatar Jun 05 '16 15:06 adammaj1