Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7774275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:20:13+00:00 2026-06-01T17:20:13+00:00

From this tutorial . see i have one pre-built static library named as stackoverflow.a

  • 0

From this tutorial.

see i have one pre-built static library named as stackoverflow.a and it has stackoverflow.h

now i want to use the function of that static library in

ndk_demo.c // that tutorial has this file

for that inside ndk_demo.c i have added

#include 'stackoverflow.h'  

Edit

inside `android-ndk-r7c`
         |
        apps
         |
        ndk_demo
         |
     -----------------
     |               |
   project          Application.mk
     |
--------------------
|                   |
all other           |
folder             jni
                    |  
-------------------------------------------------------------------
  |               |                     |          |              |
ndk_demo.c      stackoverflow.h        lib    com_marakana       Android.mk
                                        |      _NativeLib.h
                                        |
                             --------------------
                             |                   |
                          Android.mk          libstackoverflow.a

Now Application.mk

APP_PROJECT_PATH := $(call my-dir)/project
APP_MODULES      := ndk_demo stackover

Now jni/Android.mk

include $(call all-subdir-makefiles)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE    := ndk_demo
LOCAL_SRC_FILES := ndk_demo.c
LOCAL_STATIC_LIBRARIES := stackover
include $(BUILD_SHARED_LIBRARY)

now jni/lib/Android.mk

   LOCAL_PATH := $(call my-dir)
   include $(CLEAR_VARS)
   LOCAL_MODULE := stackover
   LOCAL_SRC_FILES := libstackoverflow.a
   include $(PREBUILT_STATIC_LIBRARY)
   LOCAL_PATH := $(call my-dir)

Now from android-ndk-r7c directory
i run

make APP=ndk_demo

it shows me error like

Android NDK: Building for application 'ndk_demo'    
make: *** No rule to make target `build/core/ndk_demo.c', needed by `out/apps/ndk_demo/armeabi/objs/ndk_demo/ndk_demo.o'.  Stop.

why this happening i am not getting ?

if i comment

#include $(call all-subdir-makefiles)

this from jni/Android.mk then it shows following error

Android NDK: Building for application 'ndk_demo'    
Compile thumb  : ndk_demo <= ndk_demo.c
SharedLibrary  : libndk_demo.so
./out/apps/ndk_demo/armeabi/objs/ndk_demo/ndk_demo.o: In function `Java_com_marakana_NativeLib_hello':
/home/jeegar/android-ndk-r7c/apps/ndk_demo/project/jni/ndk_demo.c:10: undefined reference to `stackoverflowInit'
collect2: ld returned 1 exit status
make: *** [out/apps/ndk_demo/armeabi/libndk_demo.so] Error 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:20:14+00:00Added an answer on June 1, 2026 at 5:20 pm

    when you get “make: * No rule to make target `something.c'”, it just means it can’t find the file.

    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:

    (doesn't matter which directory)
    |
    -->(ndk_demo)
    -->-->(jni)
    -->-->-->Application.mk
    -->-->-->Android.mk
    -->-->-->com_marakana_NativeLib.h
    -->-->-->ndk_demo.c
    -->-->(stackoverflow)
    -->-->-->stackoverflow.h
    -->-->-->libstackoverflow.a
    

    Then I would use the following makefile:

    Android.mk:

    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)
    

    And the following:

    Application.mk:

    APP_MODULES := ndk_demo
    APP_PLATFORM := android-8
    

    Then finally, I would navigate to the directory (ndk_demo) and run ndk-build.

    ndk-build is android’s build tool. You should use it. It can be found at:

    (AndroidSDK)/(NDK)/ndk-build
    

    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.

    http://www.windows7hacker.com/index.php/2010/05/how-to-addedit-environment-variables-in-windows-7/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning JPA from this tutorial . I have some confusions in understanding
I'm new to NHibernate... I have been following this NHibernate Tutorial from Gabriel Schenker
I extracted this from a tutorial: Little-Endian order is the one we will be
I've used the exact files from this tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/ The ideea is to submit
I've been trying to recreate an effect from this tutorial: http://jqueryfordesigners.com/jquery-look-tim-van-damme/ Unfortunately, I want
I managed to get authentication to work by following the tutorial from this page
in this tutorial of Yii framework http://www.yiiframework.com/doc/guide/1.1/en/basics.controller#action i want to put my Actions from
I got this from for a login form tutorial: function sanitize($securitystring) { $securitystring =
I am trying this simple tutorial from oracle : http://www.oracle.com/technetwork/java/socket-140484.html (the Example 1 ).
This code comes from a tutorial so it's not originally my own work. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.