LOCAL_SRC_FILES points to a missing file

2019-06-14 20:39发布

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.

7条回答
我命由我不由天
2楼-- · 2019-06-14 21:41

Just contributing to the list of working solutions, just in case all the above did not work.

In my case, it turned out that there was a space in my path. Cygwin does not like spaces in paths very much. Removing the spaces in my path fixed the issue.

As a tip, you may wish to have your working directory in a path like C:\projects\MyNativeProject and your Android SDK and NDK on paths without spaces.

查看更多
登录 后发表回答