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 2413

Summary: Fix for the undefined reference... Tiff4 errors when compiling everything as static.
Product: SDL_image Reporter: Sandu Liviu Catalin <slc.universe>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86   
OS: Windows 7   
Attachments: IMG_tif.c file patch

Description Sandu Liviu Catalin 2014-02-22 18:41:24 UTC
Created attachment 1571 [details]
IMG_tif.c file patch

Compiling every external library (zlib, libpng, libjpeg, libtiff4 and libwebp) and SDL_image as static libraries and then linking them to an executable project with Code::Blocks and MinGW (4.8.2 x86) fails to compile because of the LibTiff4 library which gives a couple of undefined reference errors for _TIFFmalloc, _TIFFrealloc, _TIFFerrorHandler etc.

Tested on clean SDL_image clone from the repository.

A temporary workaround for this problem was attached (part of the code was taken from FreeImage). The fix allows SDL_image to be compiled with static versions of LibTiff4 library.
Comment 1 Sam Lantinga 2014-02-23 01:20:18 UTC
It looks like these functions are supposed to be provided with libtiff. Can you see if they're in another library on the system?
Comment 2 Sandu Liviu Catalin 2014-02-23 16:43:51 UTC
After some manual searching though the LibTiff4 library files I found some info in the Changelog file and apparently there is libtiff/tif_{unix,vms,win32}.c that has them implemented but the file wasn't included in my Code::Blocks project.