Reputation: 398
I have setup android ndk and tested it using the samples in the ndk folder.
I think my error is something to-do with the paths but I am not sure how to fix it. I think my problem is similar to this question LOCAL_SRC_FILES points to a missing file but there is no solution given and therefore my question is not a duplicate.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := QCAR-prebuilt
LOCAL_SRC_FILES = ../../../build/lib/$(TARGET_ARCH_ABI)/libQCAR.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../build/include
include $(PREBUILT_SHARED_LIBRARY)
#-----------------------------------------------------------------------------
include $(CLEAR_VARS)
LOCAL_MODULE := ImageTargets
# The TARGET_PLATFORM defines the targetted Android Platform API level
TARGET_PLATFORM := android-5
# This variable determines the OpenGL ES API version to use:
# If set to true, OpenGL ES 1.1 is used, otherwise OpenGL ES 2.0.
USE_OPENGL_ES_1_1 := false
# Set OpenGL ES version-specific settings.
ifeq ($(USE_OPENGL_ES_1_1), true)
OPENGLES_LIB := -lGLESv1_CM
OPENGLES_DEF := -DUSE_OPENGL_ES_1_1
else
OPENGLES_LIB := -lGLESv2
OPENGLES_DEF := -DUSE_OPENGL_ES_2_0
endif
LOCAL_CFLAGS := -Wno-write-strings $(OPENGLES_DEF)
LOCAL_LDLIBS := \
-llog $(OPENGLES_LIB)
LOCAL_SHARED_LIBRARIES := QCAR-prebuilt
.
LOCAL_SRC_FILES := ImageTargets.cpp SampleUtils.cpp Texture.cpp
LOCAL_ARM_MODE := arm
include $(BUILD_SHARED_LIBRARY)
Upvotes: 0
Views: 1148
Reputation: 57163
Look at the answer to a similar problem here: ndk build library outside main project source tree
Note also that when you specify LOCAL_SRC_FILES, NDK will look for them relative to LOCAL_PATH (i.e. where your Android.mk lives).
Finally, with ndk-r8b on Windows it is easier to avoid cygwin and use ndk-build.cmd and not open bash
Upvotes: 1