Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>when you get "make: <em>*</em> No rule to make target `something.c'", it just means it can't find the file.</p> <p>I'm a bit confused why you've organized your project like that, but if I was going to build your project, I would do it as follows:</p> <pre><code>(doesn't matter which directory) | --&gt;(ndk_demo) --&gt;--&gt;(jni) --&gt;--&gt;--&gt;Application.mk --&gt;--&gt;--&gt;Android.mk --&gt;--&gt;--&gt;com_marakana_NativeLib.h --&gt;--&gt;--&gt;ndk_demo.c --&gt;--&gt;(stackoverflow) --&gt;--&gt;--&gt;stackoverflow.h --&gt;--&gt;--&gt;libstackoverflow.a </code></pre> <p>Then I would use the following makefile:</p> <p><strong>Android.mk:</strong></p> <pre><code>LOCAL_PATH := $(call my-dir) ### include stackoverflow as a prebuilt lib ### include $(CLEAR_VARS) LOCAL_MODULE := stackoverflow-prebuilt LOCAL_SRC_FILES := ../stackoverflow/libstackoverflow.a LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../stackoverflow include $(PREBUILT_STATIC_LIBRARY) ### build your ndk lib ### include $(CLEAR_VARS) LOCAL_MODULE := ndk_demo LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../stackoverflow LOCAL_SRC_FILES := ndk_demo.c LOCAL_LDLIBS := -llog LOCAL_STATIC_LIBRARIES := stackoverflow-prebuilt include $(BUILD_SHARED_LIBRARY) </code></pre> <p>And the following:</p> <p><strong>Application.mk:</strong></p> <pre><code>APP_MODULES := ndk_demo APP_PLATFORM := android-8 </code></pre> <p>Then finally, I would navigate to the directory (ndk_demo) and run ndk-build.</p> <p>ndk-build is android's build tool. You should use it. It can be found at:</p> <pre><code>(AndroidSDK)/(NDK)/ndk-build </code></pre> <p>if you are using windows, you will either have to type the full path of ndk-build into the console, or add an environment variable to your system before trying to run it.</p> <p><a href="http://www.windows7hacker.com/index.php/2010/05/how-to-addedit-environment-variables-in-windows-7/">http://www.windows7hacker.com/index.php/2010/05/how-to-addedit-environment-variables-in-windows-7/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload