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 9172047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:15:07+00:00 2026-06-17T16:15:07+00:00

I’m having a similar problem to what this person was having: Android NDK import-module

  • 0

I’m having a similar problem to what this person was having:

Android NDK import-module / code reuse

But for some reason when I implement the solution that they listed, it doesn’t work for me. The only difference I have in my project is that I am using 1 makefile for the entire project. So, the modules look like this: (… = more files or paths)

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := mod1
LOCAL_C_INCLUDES := $(LOCAL_PATH)/to/c/includes \
... \
LOCAL_SRC_FILES := stringTester.cpp \
... \
include$(BUILD_STATIC_LIBRARY)


include $(CLEAR_VARS)

LOCAL_MODULE := mod2
LOCAL_C_INCLUDES := $(LOCAL_PATH)/to/c/includes \
... \
LOCAL_SRC_FILES := localSourceFile.cpp \
... \
include$(BUILD_STATIC_LIBRARY)

and so on for 2 more modules, then in the final module:

include $(CLEAR_VARS)

LOCAL_MODULE := sharedMod
LOCAL_C_INCLUDES := $(LOCAL_PATH)/to/c/includes \
... \
LOCAL_STATIC_LIBRARIES := mod1 mod2 mod3 mod4
... \
include $(BUILD_SHARED_LIBRARY)

and in my java file:

package com.string.test

public class javaTest{

public native String returnAString();

static{
    System.LoadLibrary("sharedMod");
  }
}

The problem I’m running into is that I cannot call any methods from the static libraries, such as any method in stringTester.cpp, but if I move that file to be included in the module that creates the shared library, everything works as it should, the Java wrappers are correct and methods return the data I expect. The only reason why I don’t move all the files into a shared library are they are separate and evolving projects, such as our physics engine and so forth.

I have also tried separating the modules with each module having its own makefile, and also having a cpp file in the shared library that called the methods in the static libraries but I would get a lot of unresolved reference failures. One other solution I have tried was to use LOCAL_WHOLE_STATIC_LIBRARIES to load the static libraries but that gave me unresolved reference errors as well.

Any help or suggestions are appreciated. I’m at my wits end, and at a roadblock.

  • 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-17T16:15:08+00:00Added an answer on June 17, 2026 at 4:15 pm

    The answer is definitely to use:

    LOCAL_WHOLE_STATIC_LIBRARIES := mod1 mod2 mod3 mod4
    

    I was running into other problems with including other libraries but when reduced to a simple test case, using the above macro worked. Thanks to nos for the help!!

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.