Undefined references when linking libpng
I'm compiling a planet map generator that requires libpng. While I successfully fixed other errors, this was impossible to remove:
png_utils.o:png_utils.c:(.text+0x91): undefined reference to `png_create_write_struct'
png_utils.o:png_utils.c:(.text+0xa4): undefined reference to `png_create_info_struct'
png_utils.o:png_utils.c:(.text+0xca): undefined reference to `png_set_longjmp_fn'
png_utils.o:png_utils.c:(.text+0x135): undefined reference to `png_set_IHDR'
png_utils.o:png_utils.c:(.text+0x14e): undefined reference to `png_malloc'
png_utils.o:png_utils.c:(.text+0x19e): undefined reference to `png_malloc'
png_utils.o:png_utils.c:(.text+0x217): undefined reference to `png_init_io'
png_utils.o:png_utils.c:(.text+0x230): undefined reference to `png_set_rows'
png_utils.o:png_utils.c:(.text+0x252): undefined reference to `png_write_png'
png_utils.o:png_utils.c:(.text+0x281): undefined reference to `png_free'
png_utils.o:png_utils.c:(.text+0x297): undefined reference to `png_free'
png_utils.o:png_utils.c:(.text+0x2af): undefined reference to `png_destroy_write_struct'
png_utils.o:png_utils.c:(.text+0x35e): undefined reference to `png_malloc'
png_utils.o:png_utils.c:(.text+0x47c): undefined reference to `png_destroy_read_struct'
png_utils.o:png_utils.c:(.text+0x4b4): undefined reference to `png_sig_cmp'
png_utils.o:png_utils.c:(.text+0x4e0): undefined reference to `png_create_read_struct'
png_utils.o:png_utils.c:(.text+0x4f3): undefined reference to `png_create_info_struct'
png_utils.o:png_utils.c:(.text+0x509): undefined reference to `png_create_info_struct'
png_utils.o:png_utils.c:(.text+0x52f): undefined reference to `png_set_longjmp_fn'
png_utils.o:png_utils.c:(.text+0x60e): undefined reference to `png_init_io'
png_utils.o:png_utils.c:(.text+0x621): undefined reference to `png_set_sig_bytes'
png_utils.o:png_utils.c:(.text+0x643): undefined reference to `png_read_png'
png_utils.o:png_utils.c:(.text+0x689): undefined reference to `png_get_IHDR'
png_utils.o:png_utils.c:(.text+0x6f2): undefined reference to `png_get_rowbytes'
png_utils.o:png_utils.c:(.text+0x718): undefined reference to `png_get_rows'
png_utils.o:png_utils.c:(.text+0x941): undefined reference to `png_destroy_read_struct'
I use MinGW-x64 and mingw32-make without msys2 installed. libpng 1.6.37-4 is installed in both folders and I used -lpng and -lpng16 but it still didn't work.
from Recent Questions - Stack Overflow https://ift.tt/2SEfFdu
https://ift.tt/eA8V8J
Comments
Post a Comment