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 4807

Summary: SDL_main
Product: SDL Reporter: jlnwntr
Component: mainAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sylvain.becker
Version: 2.0.10   
Hardware: All   
OS: Android (All)   

Description jlnwntr 2019-09-23 12:37:33 UTC
I'm trying to run a test-SDL2-project with my Android Studio 3.5
(Build #AI-191.8026.42.35.5791312, built on August 9, 2019, JRE: 1.8.0_202-release-1483-b49-5587405 amd64, JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-64-generic (Ubuntu 18.04)) as instructed in the android-readme with SDL 2.0.10.

The project builds without any errors. However, when I try to run my super simple test-app (SDL_Init, SDL_Delay for 10 sec., SDL_Quit), I get this error in Logcat:

E/SDL: nativeRunMain(): Couldn't find function SDL_main in library /data/app/org.libsdl.app--Lrz...k0CA==/lib/x86/libmain.so
Comment 1 Sylvain 2019-09-24 10:25:03 UTC
Try "objdump -t your_path/libmain.so | grep main"
You should have a "SDL_main" inside.


In you c file where "main()" is defined, add an include of SDL.h so that it transforms main() into SDL_main().