alexcir
alexcir

Reputation: 291

Android NDK, No rule to make target

I've seen this question other places, but the answers don't seem to apply to my situation. I've got a .cpp file (not a .c file). I'm getting the error:

make: * No rule to make target jni/native.c', needed byobj/local/armeabi/objs/native/native.o'. Stop. Cirapi_android C/C++ Problem

Here's my Android.mk file (very simple):

LOCAL_PATH:=$(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS:=-llog
LOCAL_MODULE:=native
LOCAL_SRC_FILES:=native.cpp
include $(BUILD_SHARED_LIBRARY)

I've removed all the extra spaces that solved other's problems. It's complaining about native.c which I don't even have listed in my makefile. Any ideas?

I'm on MacOSX Snow Leopard, Eclipse Juno, NDK r8

Upvotes: 12

Views: 16478

Answers (1)

alexcir
alexcir

Reputation: 291

Got it to work...not sure what the key was...changed the makefile to..

TOP_LOCAL_PATH:=$(call my-dir)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(TOP_LOCAL_PATH)  

include $(CLEAR_VARS)
LOCAL_LDLIBS:=-llog
LOCAL_MODULE:=native
LOCAL_SRC_FILES:=native.cpp

include $(BUILD_SHARED_LIBRARY)

...also removed the .o files from the obj directory...suspected that a clean was not working correctly.

Upvotes: 17

Related Questions