i'm doing an augemented reality program. i was handed this project and im new to cygwin and android programming. i have to use cygwin to compile one of my cpp file. however when i do a ndk-build on cygwin this error comes out:
$ ndk-build
Android NDK: ERROR:/cygdrive/c/project/jni/Android.mk:QCAR-prebuilt: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /cygdrive/c/project/jni//../../../build/lib/armeabi/libQCAR.so exists or that its path is correct
/cygdrive/c/android-ndk-r8b/build/core/prebuilt-library.mk:43: *** Android NDK: Aborting . Stop.
and this are my android.mk codes:
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)**
I'm not a pro at programming so i would like some guidance.
I had the similar problem, I put the variable
NDK_TOOLCHAIN_VERSION
as r9, while it had to be either 4.8 or 4.4. I changed it to 4.8 and it worked.PS: Checking if the missing file actually exists or not will help.
I would like to add my 2c, just in case it helps out some poor soul. In my case, the ndk did not like the leading back slash. i.e. changing from
to
solved my issue.
Had same problem, tried multiple paths but dint work. Finally solved it problem by simply copying the sample project in the Development\Android\vuforia-sdk-android-2-0-30\samples folder and then executing ndk-build through cygwin. Hope that helps :-)
step 1 : copy sample into C:\Development\Android\vuforia-sdk-android-2-0-31\samples
step 2 : open command prompt
write commnad 1 : cd C:\Development\Android\vuforia-sdk-android-2-0-31\samples\ImageTargets-2-0-7
write commnad 2 : ndk-build
step 3 : import project into eclipses
step 4 : https://developer.vuforia.com/resources/dev-guide/step-3-compiling-running-vuforia-sample-app
so build successfully. Don't forgot to set path of ndk in Environment Variables.
use relative dir path works on Mac:
Apparently, default
Android.mk
presumes that theImageTargets
folder is located at../vuforia-sdk-android-x-x-xx/samples/ImageTargets-x-x-x
, but after I had downloaded the samples and extracted them to the samples directory, the location was the following:../vuforia-sdk-android-x-x-xx/samples/vuforia-sampleapps-android-x-x-xx/ImageTargets-x-x-x
. So it turned out that there was an additional subdirectory and this is why the build failed. To make it work I edited theAndroid.mk
as follows:should be changed to
, where the additional set of
/..
takes care of that additional subfolder. This solution worked for me.