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 2120

Summary: SDL2_image exports miniz symbols
Product: SDL_image Reporter: Robert Norris <rob>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86_64   
OS: Linux   
Attachments: make miniz functions static

Description Robert Norris 2013-09-29 00:43:00 UTC
If a project that uses SDL2_image also uses miniz directly, and we're doing a full static build, then final link will fail due to symbol conflicts between the application and the library.

(Pioneer's SDL2 port does this when building with MXE, the MinGW toolchain).

This is best addressed by making functions within miniz itself static. I've submitted a patch for this to miniz:

  https://code.google.com/p/miniz/issues/detail?id=18

In my application I've enabled this so as to make it link, but really its a workaround - the right place for this fix is in SDL2_image itself.
Comment 1 Sam Lantinga 2013-10-01 05:04:10 UTC
Can you submit a patch that applies cleanly to the version of miniz used by SDL_image (miniz_v114_r1.7z)

Thanks!
Comment 2 Robert Norris 2013-10-01 05:21:50 UTC
Created attachment 1348 [details]
make miniz functions static
Comment 3 Sam Lantinga 2013-10-01 05:41:33 UTC
Great patch, thanks!
http://hg.libsdl.org/SDL_image/rev/f4572b5b73f3