[bugfix] Solved static linking with libtiff and libpng
gdk-pixbuf gets an error when linking statically with both libraries libtiff and libpng:
gcc -o gdk-pixbuf/gdk-pixbuf-pixdata gdk-pixbuf/gdk-pixbuf-pixdata.p/gdk-pixbuf-pixdata.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--start-group gdk-pixbuf/libgdk_pixbuf-2.0.a -lm /root/.conan2/p/glib916daa5e743b2/p/lib/libglib-2.0.a -lpthread /root/.conan2/p/zlib3579ae9197e0e/p/lib/libz.a /root/.conan2/p/bzip26d48265eb59fb/p/lib/libbz2.a /root/.conan2/p/pcre21ee9850511987/p/lib/libpcre2-posix.a /root/.conan2/p/pcre21ee9850511987/p/lib/libpcre2-8.a /root/.conan2/p/pcre21ee9850511987/p/lib/libpcre2-16.a /root/.conan2/p/pcre21ee9850511987/p/lib/libpcre2-32.a /root/.conan2/p/glib916daa5e743b2/p/lib/libgobject-2.0.a /root/.conan2/p/libfff66040185d3f0/p/lib/libffi.a /root/.conan2/p/glib916daa5e743b2/p/lib/libgmodule-2.0.a -ldl /root/.conan2/p/glib916daa5e743b2/p/lib/libgio-2.0.a /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libresolv.so -Wl,--export-dynamic /root/.conan2/p/libmof9a590b42a85f/p/lib/libmount.a /root/.conan2/p/libmof9a590b42a85f/p/lib/libblkid.a -lrt /root/.conan2/p/libsebea0addfec8e2/p/lib/libselinux.a /root/.conan2/p/libsebea0addfec8e2/p/lib/libsepol.a -Wl,--end-group
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `png_save_to_callback_write_func':
io-png.c:(.text+0xc3): undefined reference to `png_get_io_ptr'
/usr/bin/ld: io-png.c:(.text+0xec): undefined reference to `png_error'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `png_simple_error_callback':
io-png.c:(.text+0x105): undefined reference to `png_get_error_ptr'
/usr/bin/ld: io-png.c:(.text+0x127): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `png_error_callback':
io-png.c:(.text+0x185): undefined reference to `png_get_error_ptr'
/usr/bin/ld: io-png.c:(.text+0x1af): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `real_save_png':
io-png.c:(.text+0x464): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: io-png.c:(.text+0x7ce): undefined reference to `png_create_write_struct'
/usr/bin/ld: io-png.c:(.text+0x7e7): undefined reference to `png_create_info_struct'
/usr/bin/ld: io-png.c:(.text+0x811): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: io-png.c:(.text+0x86b): undefined reference to `png_init_io'
/usr/bin/ld: io-png.c:(.text+0x884): undefined reference to `png_set_compression_level'
/usr/bin/ld: io-png.c:(.text+0x905): undefined reference to `png_set_pHYs'
/usr/bin/ld: io-png.c:(.text+0x938): undefined reference to `png_set_iCCP'
/usr/bin/ld: io-png.c:(.text+0x984): undefined reference to `png_set_IHDR'
/usr/bin/ld: io-png.c:(.text+0x9d0): undefined reference to `png_set_sBIT'
/usr/bin/ld: io-png.c:(.text+0x9e5): undefined reference to `png_write_info'
/usr/bin/ld: io-png.c:(.text+0x9f2): undefined reference to `png_set_packing'
/usr/bin/ld: io-png.c:(.text+0xa34): undefined reference to `png_write_rows'
/usr/bin/ld: io-png.c:(.text+0xa56): undefined reference to `png_write_end'
/usr/bin/ld: io-png.c:(.text+0xafd): undefined reference to `png_set_write_fn'
/usr/bin/ld: io-png.c:(.text+0xb26): undefined reference to `png_set_text'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `gdk_pixbuf__png_image_load_increment':
io-png.c:(.text+0xe12): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: io-png.c:(.text+0xe55): undefined reference to `png_process_data'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `gdk_pixbuf__png_image_begin_load':
io-png.c:(.text+0x101c): undefined reference to `png_create_read_struct_2'
/usr/bin/ld: io-png.c:(.text+0x1032): undefined reference to `png_create_info_struct'
/usr/bin/ld: io-png.c:(.text+0x105b): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: io-png.c:(.text+0x107e): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: io-png.c:(.text+0x10b9): undefined reference to `png_set_progressive_read_fn'
/usr/bin/ld: io-png.c:(.text+0x11c3): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `png_row_callback':
io-png.c:(.text+0x1207): undefined reference to `png_get_progressive_ptr'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `setup_png_transformations':
io-png.c:(.text+0x1319): undefined reference to `png_get_bit_depth'
/usr/bin/ld: io-png.c:(.text+0x1383): undefined reference to `png_get_IHDR'
/usr/bin/ld: io-png.c:(.text+0x13b3): undefined reference to `png_get_valid'
/usr/bin/ld: io-png.c:(.text+0x13f6): undefined reference to `png_read_update_info'
/usr/bin/ld: io-png.c:(.text+0x141d): undefined reference to `png_get_IHDR'
/usr/bin/ld: io-png.c:(.text+0x147a): undefined reference to `png_get_channels'
/usr/bin/ld: io-png.c:(.text+0x14f4): undefined reference to `png_set_expand'
/usr/bin/ld: io-png.c:(.text+0x1509): undefined reference to `png_set_strip_16'
/usr/bin/ld: io-png.c:(.text+0x151f): undefined reference to `png_set_gray_to_rgb'
/usr/bin/ld: io-png.c:(.text+0x1533): undefined reference to `png_set_interlace_handling'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `gdk_pixbuf__png_image_stop_load':
io-png.c:(.text+0x159f): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `gdk_pixbuf__png_image_load':
io-png.c:(.text+0x1778): undefined reference to `png_create_read_struct_2'
/usr/bin/ld: io-png.c:(.text+0x178c): undefined reference to `png_create_info_struct'
/usr/bin/ld: io-png.c:(.text+0x17b0): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: io-png.c:(.text+0x17ef): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: io-png.c:(.text+0x182b): undefined reference to `png_init_io'
/usr/bin/ld: io-png.c:(.text+0x183a): undefined reference to `png_read_info'
/usr/bin/ld: io-png.c:(.text+0x1908): undefined reference to `png_read_image'
/usr/bin/ld: io-png.c:(.text+0x1917): undefined reference to `png_read_end'
/usr/bin/ld: io-png.c:(.text+0x1930): undefined reference to `png_get_text'
/usr/bin/ld: io-png.c:(.text+0x19d3): undefined reference to `png_get_iCCP'
/usr/bin/ld: io-png.c:(.text+0x1a25): undefined reference to `png_get_pHYs'
/usr/bin/ld: io-png.c:(.text+0x1a4b): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: io-png.c:(.text+0x1b47): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `png_info_callback':
io-png.c:(.text+0x1b89): undefined reference to `png_get_progressive_ptr'
/usr/bin/ld: io-png.c:(.text+0x1cb8): undefined reference to `png_get_text'
/usr/bin/ld: io-png.c:(.text+0x1d25): undefined reference to `png_get_iCCP'
/usr/bin/ld: io-png.c:(.text+0x1d47): undefined reference to `png_get_pHYs'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `png_end_callback':
io-png.c:(.text+0x11e5): undefined reference to `png_get_progressive_ptr'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `png_row_callback':
io-png.c:(.text+0x1290): undefined reference to `png_progressive_combine_row'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-jpeg.c.o): in function `real_save_jpeg':
io-jpeg.c:(.text+0x5df): undefined reference to `jpeg_std_error'
/usr/bin/ld: io-jpeg.c:(.text+0x684): undefined reference to `jpeg_destroy_compress'
/usr/bin/ld: io-jpeg.c:(.text+0x6f7): undefined reference to `jpeg_CreateCompress'
/usr/bin/ld: io-jpeg.c:(.text+0x775): undefined reference to `jpeg_set_defaults'
/usr/bin/ld: io-jpeg.c:(.text+0x789): undefined reference to `jpeg_set_quality'
/usr/bin/ld: io-jpeg.c:(.text+0x7c7): undefined reference to `jpeg_start_compress'
/usr/bin/ld: io-jpeg.c:(.text+0x8d4): undefined reference to `jpeg_write_marker'
/usr/bin/ld: io-jpeg.c:(.text+0x97d): undefined reference to `jpeg_write_marker'
/usr/bin/ld: io-jpeg.c:(.text+0xa18): undefined reference to `jpeg_write_scanlines'
/usr/bin/ld: io-jpeg.c:(.text+0xa44): undefined reference to `jpeg_finish_compress'
/usr/bin/ld: io-jpeg.c:(.text+0xa4c): undefined reference to `jpeg_destroy_compress'
/usr/bin/ld: io-jpeg.c:(.text+0xacb): undefined reference to `jpeg_destroy_compress'
/usr/bin/ld: io-jpeg.c:(.text+0xaf5): undefined reference to `jpeg_stdio_dest'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-jpeg.c.o): in function `gdk_pixbuf__jpeg_image_load_lines':
io-jpeg.c:(.text+0xea9): undefined reference to `jpeg_read_scanlines'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-jpeg.c.o): in function `gdk_pixbuf__jpeg_image_stop_load':
io-jpeg.c:(.text+0x107a): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: io-jpeg.c:(.text+0x1124): undefined reference to `jpeg_finish_decompress'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-jpeg.c.o): in function `gdk_pixbuf__jpeg_image_begin_load':
io-jpeg.c:(.text+0x11d8): undefined reference to `jpeg_std_error'
/usr/bin/ld: io-jpeg.c:(.text+0x123c): undefined reference to `jpeg_CreateDecompress'
/usr/bin/ld: io-jpeg.c:(.text+0x1260): undefined reference to `jpeg_resync_to_restart'
/usr/bin/ld: io-jpeg.c:(.text+0x12e1): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-jpeg.c.o): in function `gdk_pixbuf__jpeg_image_load_increment':
io-jpeg.c:(.text+0x1a36): undefined reference to `jpeg_save_markers'
/usr/bin/ld: io-jpeg.c:(.text+0x1a48): undefined reference to `jpeg_save_markers'
/usr/bin/ld: io-jpeg.c:(.text+0x1a5a): undefined reference to `jpeg_save_markers'
/usr/bin/ld: io-jpeg.c:(.text+0x1a67): undefined reference to `jpeg_read_header'
/usr/bin/ld: io-jpeg.c:(.text+0x1b0a): undefined reference to `jpeg_calc_output_dimensions'
/usr/bin/ld: io-jpeg.c:(.text+0x1b26): undefined reference to `jpeg_calc_output_dimensions'
/usr/bin/ld: io-jpeg.c:(.text+0x1d03): undefined reference to `jpeg_start_output'
/usr/bin/ld: io-jpeg.c:(.text+0x1d48): undefined reference to `jpeg_finish_output'
/usr/bin/ld: io-jpeg.c:(.text+0x1d5d): undefined reference to `jpeg_input_complete'
/usr/bin/ld: io-jpeg.c:(.text+0x1d69): undefined reference to `jpeg_input_complete'
/usr/bin/ld: io-jpeg.c:(.text+0x1dc5): undefined reference to `jpeg_start_decompress'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-jpeg.c.o): in function `gdk_pixbuf__real_jpeg_image_load':
io-jpeg.c:(.text+0x2110): undefined reference to `jpeg_std_error'
/usr/bin/ld: io-jpeg.c:(.text+0x216e): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: io-jpeg.c:(.text+0x21bb): undefined reference to `jpeg_CreateDecompress'
/usr/bin/ld: io-jpeg.c:(.text+0x223d): undefined reference to `jpeg_resync_to_restart'
/usr/bin/ld: io-jpeg.c:(.text+0x2258): undefined reference to `jpeg_save_markers'
/usr/bin/ld: io-jpeg.c:(.text+0x226a): undefined reference to `jpeg_save_markers'
/usr/bin/ld: io-jpeg.c:(.text+0x227c): undefined reference to `jpeg_save_markers'
/usr/bin/ld: io-jpeg.c:(.text+0x2289): undefined reference to `jpeg_read_header'
/usr/bin/ld: io-jpeg.c:(.text+0x22a2): undefined reference to `jpeg_start_decompress'
/usr/bin/ld: io-jpeg.c:(.text+0x24a8): undefined reference to `jpeg_read_scanlines'
/usr/bin/ld: io-jpeg.c:(.text+0x2535): undefined reference to `jpeg_finish_decompress'
/usr/bin/ld: io-jpeg.c:(.text+0x253d): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o): in function `gdk_pixbuf__tiff_image_load_increment':
io-tiff.c:(.text+0x342): undefined reference to `TIFFSetErrorHandler'
/usr/bin/ld: io-tiff.c:(.text+0x34a): undefined reference to `TIFFSetWarningHandler'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o): in function `tiff_image_parse':
io-tiff.c:(.text+0x480): undefined reference to `TIFFGetField'
/usr/bin/ld: io-tiff.c:(.text+0x4a3): undefined reference to `TIFFGetField'
/usr/bin/ld: io-tiff.c:(.text+0x58b): undefined reference to `TIFFGetField'
/usr/bin/ld: io-tiff.c:(.text+0x5ad): undefined reference to `TIFFGetField'
/usr/bin/ld: io-tiff.c:(.text+0x618): undefined reference to `TIFFGetField'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o):io-tiff.c:(.text+0x63f): more undefined references to `TIFFGetField' follow
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o): in function `tiff_image_parse':
io-tiff.c:(.text+0x695): undefined reference to `TIFFReadRGBAImageOriented'
/usr/bin/ld: io-tiff.c:(.text+0x6a5): undefined reference to `TIFFReadDirectory'
/usr/bin/ld: io-tiff.c:(.text+0x890): undefined reference to `TIFFGetField'
/usr/bin/ld: io-tiff.c:(.text+0x8a4): undefined reference to `TIFFGetField'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o): in function `gdk_pixbuf__tiff_image_stop_load':
io-tiff.c:(.text+0xa87): undefined reference to `TIFFSetErrorHandler'
/usr/bin/ld: io-tiff.c:(.text+0xa8f): undefined reference to `TIFFSetWarningHandler'
/usr/bin/ld: io-tiff.c:(.text+0xada): undefined reference to `TIFFClientOpen'
/usr/bin/ld: io-tiff.c:(.text+0xb14): undefined reference to `TIFFClose'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o): in function `gdk_pixbuf__tiff_image_load':
io-tiff.c:(.text+0xd0f): undefined reference to `TIFFSetErrorHandler'
/usr/bin/ld: io-tiff.c:(.text+0xd17): undefined reference to `TIFFSetWarningHandler'
/usr/bin/ld: io-tiff.c:(.text+0xd41): undefined reference to `TIFFFdOpen'
/usr/bin/ld: io-tiff.c:(.text+0xd61): undefined reference to `TIFFClose'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o): in function `gdk_pixbuf__tiff_image_save_to_callback':
io-tiff.c:(.text+0xe4d): undefined reference to `TIFFSetErrorHandler'
/usr/bin/ld: io-tiff.c:(.text+0xe55): undefined reference to `TIFFSetWarningHandler'
/usr/bin/ld: io-tiff.c:(.text+0xeb9): undefined reference to `TIFFClientOpen'
/usr/bin/ld: io-tiff.c:(.text+0xf37): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0xf4a): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x1064): undefined reference to `TIFFIsCODECConfigured'
/usr/bin/ld: io-tiff.c:(.text+0x1081): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x10b8): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x10da): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x10ee): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x110a): undefined reference to `TIFFSetField'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o):io-tiff.c:(.text+0x114b): more undefined references to `TIFFSetField' follow
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o): in function `gdk_pixbuf__tiff_image_save_to_callback':
io-tiff.c:(.text+0x11d2): undefined reference to `TIFFWriteScanline'
/usr/bin/ld: io-tiff.c:(.text+0x1211): undefined reference to `TIFFClose'
/usr/bin/ld: io-tiff.c:(.text+0x1420): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x1434): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x1448): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x145c): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x146f): undefined reference to `TIFFSetField'
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o):io-tiff.c:(.text+0x1483): more undefined references to `TIFFSetField' follow
/usr/bin/ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-tiff.c.o): in function `gdk_pixbuf__tiff_image_save_to_callback':
io-tiff.c:(.text+0x175d): undefined reference to `TIFFWriteScanline'
/usr/bin/ld: io-tiff.c:(.text+0x1901): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x191d): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x193d): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x1945): undefined reference to `TIFFClose'
/usr/bin/ld: io-tiff.c:(.text+0x19b0): undefined reference to `TIFFSetField'
/usr/bin/ld: io-tiff.c:(.text+0x19c4): undefined reference to `TIFFSetField'
collect2: error: ld returned 1 exit status
[166/166] Generating gdk-pixbuf/loaders.cache with a custom command (wrapped by meson to capture output)
ninja: build stopped: subcommand failed.
Pull request related: https://github.com/conan-io/conan-center-index/pull/21137