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 5458

Summary: iOS always defines main() even if built as a shared library
Product: SDL Reporter: Caleb Cornett <spydog>
Component: mainAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-2.0.16
Version: 2.0.15   
Hardware: x86   
OS: iOS (All)   

Description Caleb Cornett 2021-01-10 23:29:18 UTC
Before the Xcode/Xcode-iOS merge, the iOS SDL_main definition could be disabled for shared libraries by defining IOS_DYLIB=1 (which is still defined in the iOS-Shared target in the new Xcode project file). However, the check for that define was removed so main() is now always defined: https://hg.libsdl.org/SDL/rev/6c2bbcfc3940 vs. https://hg.libsdl.org/SDL/file/17d911637a65/src/main/uikit/SDL_uikit_main.c

This is problematic for applications which do not statically link with SDL2, or which have their own main function. It seems the simplest solution is to just copy the #if defined(...) from the old uikitappdelegate code into SDL_uikit_main, but there might be a better option.