djkarstenv wrote:
I am guessing i did not successfully build the SDL source code. So how do i do that?
all the info is in the readmes and on google. take it step by step.
you don’t need to build the SDL sources for android, that is done for you by the build system.
you should mention you are on Windows. i think you can still make symbolic links but that’s not the way windows ppl think so it’ll just be copies 
-
first of all, start with a fresh copy of the SDL2 sources extracted to C:\SDL2_android. it’s important that this folder is never used to build the SDL for the windows target.
-
copy C:\SDL2_android\android-project to C:<project>. this whole directory will only ever be for one android project so name it like that.
-
copy your whole source tree into C:<project>\jni\src
-
copy the whole C:\SDL2_android folder into C:<project>\jni
-
rename the C:<project>\jni\SDL2_android folder to C:<project>\jni\SDL (this is another place where symbolic linking makes sense but copies work!)
-
edit the C:<project>\jni\src\Android.mk file (info below)
-
run ndk-build from C:<project>
now everything is in place and the only step left is to configure Android.mk to help the NDK build system. i’m copying my working Android.mk file below for reference. any wrong move here will make it totally fail so don’t edit any files unless you find some documentation that says to.
notice:
the SDL_PATH is …/SDL this points to the folder you copied then renamed in steps 4 and 5.
files have $(LOCAL_PATH) in front of them. if you want to compile C:<project>\jni\src\main.cpp, you want to have
LOCAL_SRC_FILES := $(LOCAL_PATH)/main.cpp
in my case, i have a folder under /jni/src so my main is C:<project>\jni\src\Source\main.cpp and this file gets added automatically by the lines
SOURCE_DIRS := Source
SOURCE_FILES := $(foreach dir,$(SOURCE_DIRS),$(subst $(LOCAL_PATH)/,$(wildcard $(LOCAL_PATH)/$(dir)/*.cpp)))
LOCAL_SRC_FILES := $(SOURCE_FILES)
also helpful is the line
$(warning $(SOURCE_FILES))
which prints out exactly what you are sending to the compiler.
in your case you would want to put
$(warning $(LOCAL_SRC_FILES))
near the bottom of the file.
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := main
SDL_PATH := …/SDL
SOURCE_DIRS := Source Source/App Source/Platform Source/Environment Source/Environment/Expression Source/GUI Source/Dash Source/Platform/SDL2_0 Source/Platform/Android Source/Dash Source/Platform/SDL2_0/OpenGLES20
SOURCE_FILES := $(foreach dir,$(SOURCE_DIRS),$(subst $(LOCAL_PATH)/,$(wildcard $(LOCAL_PATH)/$(dir)/*.cpp)))
$(warning “-------------------------”)
$(warning “target files:”)
$(warning $(SOURCE_FILES))
$(warning “-------------------------”)
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
$(SOURCE_FILES)
LOCAL_SHARED_LIBRARIES := SDL2
LOCAL_CFLAGS := -Wno-format-security -fexceptions -I/usr/local/include/boost_1_49_0/
LOCAL_LDLIBS := -llog -lGLESv2
include $(BUILD_SHARED_LIBRARY)
if you still have errors, paste the exact text and give more info about your compiler.
from one noob to another: HTH 