Я пытаюсь запустить мою sd
l игру на Android, я следовал учебнику lazyfoo's
, чтобы запустить helloworld
, которая работала нормально, позже я импортировал свой проект, этот исходный код проекта работает в Windows без ошибок , но теперь я вижу много ошибок в моих файлах, я новичок в Android, я чувствую, что перепутал пути к моим исходным файлам. ниже ошибка:
Android.mk (внутри каталога src):
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := main
SDL_PATH := ../SDL2
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include $(LOCAL_PATH)/../SDL2_image/ $(LOCAL_PATH)/../SDL2_ttf/ $(LOCAL_PATH)/../SDL2_mixer/ $(LOCAL_PATH)/src/Engine/coremodules/ $(LOCAL_PATH)/src/Engine/coremodules/UI $(LOCAL_PATH)/src/
# Add your application source files here...
LOCAL_SRC_FILES := main.cpp TestAnimator.cpp TestApplication.cpp TestScene.cpp TestPlayer.cpp Engine/coremodules/EActor.cpp Engine/coremodules/EAnimationClip.cpp Engine/coremodules/EAnimationController.cpp Engine/coremodules/EApplication.cpp Engine/coremodules/EAudioChunkComponent.cpp Engine/coremodules/EAudioMusicComponent.cpp Engine/coremodules/ECamera.cpp Engine/coremodules/EDebug.cpp Engine/coremodules/EGameObject.cpp Engine/coremodules/EInput.cpp Engine/coremodules/EScene.cpp Engine/coremodules/EText.cpp Engine/coremodules/ETexture.cpp Engine/coremodules/ETimer.cpp Engine/coremodules/ETransform.cpp Engine/coremodules/EUtil.cpp Engine/coremodules/EVector.cpp Engine/coremodules/EWindow.cpp Engine/coremodules/UI/EUIComponents.cpp Engine/coremodules/UI/EUIController.cpp
LOCAL_SHARED_LIBRARIES := SDL2 SDL2_image SDL2_ttf SDL2_mixer
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog
LOCAL_CPPFLAGS += -std=c++11
include $(BUILD_SHARED_LIBRARY)
application.mk:
# Uncomment this if you're using STL in your project
# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
APP_STL := stlport_static
#armeabi-v7a arm64-v8a x86 x86_64
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
# Min runtime API level
APP_PLATFORM=android-14
build.gradle
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
def buildAsApplication = !buildAsLibrary
if (buildAsApplication) {
apply plugin: 'com.android.application'
}
else {
apply plugin: 'com.android.library'
}
android {
compileSdkVersion 19
buildToolsVersion "26.0.1"
defaultConfig {
if (buildAsApplication) {
applicationId "org.libsdl.app"
}
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-14"
}
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
sourceSets.main {
jniLibs.srcDir 'libs'
}
externalNativeBuild {
ndkBuild {
path 'jni/Android.mk'
}
}
}
lintOptions {
abortOnError false
}
if (buildAsLibrary) {
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith(".aar")) {
def fileName = "org.libsdl.app.aar";
output.outputFile = new File(outputFile.parent, fileName);
}
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
}
Может кто-нибудь это пересмотреть.
Спасибо.