We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1660

Summary: /usr/lib/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG': | (.text+0x12)||undefined reference to `jpeg_calc_output_dimensions'|
Product: SDL_image Reporter: SwordBearer <tangyuchun>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: ahelper2
Version: unspecified   
Hardware: x86   
OS: Linux   

Description SwordBearer 2012-12-10 19:16:47 UTC
I used libSDL_image.a in my SDL codes,and call IMG_Load()method,
then Code:Block said this error:
===============================================================================================================================================================

/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0xff)||undefined reference to `jpeg_calc_output_dimensions'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0x109)||undefined reference to `jpeg_CreateDecompress'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0x113)||undefined reference to `jpeg_destroy_decompress'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0x11d)||undefined reference to `jpeg_finish_decompress'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0x127)||undefined reference to `jpeg_read_header'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0x131)||undefined reference to `jpeg_read_scanlines'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0x13b)||undefined reference to `jpeg_resync_to_restart'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0x145)||undefined reference to `jpeg_start_decompress'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_jpg.o)||In function `IMG_InitJPG':|
(.text+0x14f)||undefined reference to `jpeg_std_error'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0x53)||undefined reference to `png_create_info_struct'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0x5d)||undefined reference to `png_create_read_struct'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0x67)||undefined reference to `png_destroy_read_struct'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0x71)||undefined reference to `png_get_IHDR'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0x7b)||undefined reference to `png_get_channels'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0x85)||undefined reference to `png_get_io_ptr'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0x8f)||undefined reference to `png_get_PLTE'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0x99)||undefined reference to `png_get_tRNS'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xa3)||undefined reference to `png_get_valid'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xad)||undefined reference to `png_read_image'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xb7)||undefined reference to `png_read_info'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xc1)||undefined reference to `png_read_update_info'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xcb)||undefined reference to `png_set_expand'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xd5)||undefined reference to `png_set_gray_to_rgb'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xdf)||undefined reference to `png_set_packing'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xe9)||undefined reference to `png_set_read_fn'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xf3)||undefined reference to `png_set_strip_16'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_png.o)||In function `IMG_InitPNG':|
(.text+0xfd)||undefined reference to `png_sig_cmp'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_tif.o)||In function `IMG_InitTIF':|
(.text+0x12f)||undefined reference to `TIFFClientOpen'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_tif.o)||In function `IMG_InitTIF':|
(.text+0x139)||undefined reference to `TIFFClose'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_tif.o)||In function `IMG_InitTIF':|
(.text+0x143)||undefined reference to `TIFFGetField'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_tif.o)||In function `IMG_InitTIF':|
(.text+0x14d)||undefined reference to `TIFFReadRGBAImage'|
/usr/lib/i386-linux-gnu/libSDL_image.a(IMG_tif.o)||In function `IMG_InitTIF':|
(.text+0x157)||undefined reference to `TIFFSetErrorHandler'|
||=== Build finished: 32 errors, 0 warnings ===|

================================================================================================================================================================
so ,I delete the libSDL_image.a lib,and add the libSDL_image.so lib(they are both in the '/usr/lib/i386-linux-gnu' directory ).
it compiled success!
Comment 1 ahelper2 2013-05-01 19:46:37 UTC
I would say to broaden this as I have dynamic loading of libjpeg and I am also getting failures.  The issue is on IMG_jpg.c:66, dlopen fails to find the .so for libjpeg even though I can access it fine.  I had a previous version of SDL_image and it worked just fine.

I will try to find out what is causing this later today.
Comment 2 Sam Lantinga 2013-06-03 01:51:00 UTC
Any luck finding the issue with the RC snapshot?
http://www.libsdl.org/tmp/SDL_image/
Comment 3 ahelper2 2013-06-03 08:34:55 UTC
I just built the latest source and it does find and use the right version of libjpeg and libpng and links nicely. I just tested it and I am seeing images loading just fine, thanks. I did force what libpng and libjpeg were found for my previous builds of SDL_image, so I don't know 100% if the successful build is influenced at all from my previous efforts.  Otherwise, I would say it is fixed.