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 - SDL_main
Summary: SDL_main
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: 2.0.10
Hardware: All Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-23 12:37 UTC by jlnwntr
Modified: 2019-09-24 10:25 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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().