Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


SDL 2.0 compiling for android


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Alex_kir   Members   -  Reputation: 313

Like
0Likes
Like

Posted 05 October 2013 - 01:20 PM

So I decided to use SDL 2.0 to develop for the android platform. I downloaded the Android SDK/eclipse/NDK, I installed eclipse and I've set up the project directory and everything ( took me a full day of research and downloading D: ).

 

So my eclipse project currently looks like this:

 

eclipse.png

 

 

Now only thing left is to compile the SDL library with the NDK.

 

NDK.png

 

 

 

And here is where I get an error saying:

 

"Unresolved reference to SDL_main."

 

I tryed to search on google but I couldnt find any solutions. I tryed changing int main(...) to SDL_main but that didnt work either. I am totaly out of ideas and google doesnt seem to be of much help either D:, any help would be priceless <3. Thanks in advance

 

P.S: if you need me to provide any more info, let me know ^^.

P.S2: my Android.mk file looks like this:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := main

SDL_PATH := ../SDL

LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include

# Add your application source files here...
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
	main.cpp

LOCAL_SHARED_LIBRARIES := SDL2

LOCAL_LDLIBS := -lGLESv1_CM -llog

include $(BUILD_SHARED_LIBRARY)


Edited by Alex_kir, 05 October 2013 - 01:37 PM.


Sponsor:

#2 farmdve   Members   -  Reputation: 194

Like
0Likes
Like

Posted 05 October 2013 - 05:12 PM

Well, on PC usually you have to add the library libSDL2_main.a for the project to compile. See if you have not missed adding it. 



#3 Ludus   Members   -  Reputation: 970

Like
0Likes
Like

Posted 05 October 2013 - 05:40 PM

Are the dependencies set up correctly for your project? Using SDL2 requires you to add SDL2.lib as well as SDL2main.lib to the project dependencies.



#4 Alex_kir   Members   -  Reputation: 313

Like
0Likes
Like

Posted 05 October 2013 - 06:58 PM

Uh admitivly I dont know alot about compiling but as far as I understand, I use the NDK to compile the actuall SDL source files themselfs. So without actually having the library build to begin with I dont know how I can link it in the eclipse project o.o



#5 farmdve   Members   -  Reputation: 194

Like
0Likes
Like

Posted 06 October 2013 - 06:47 AM

Ah, yeah that makes sense. Not sure what the problem is. Did you follow the instructions to the letter?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS