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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:44:18+00:00 2026-05-25T03:44:18+00:00

Very simple question, hoping for a very simple answer. I’ve been looking at a

  • 0

Very simple question, hoping for a very simple answer. I’ve been looking at a lot of people’s android.mk files and have noticed this line. I had no documentation on it within my NDK’s docs (at least find . -name "*.txt" | xargs grep "LOCAL_EXPORT_C_INCLUDES" came up with nothing). This was the only documentation I’ve read on it…goes way over my head…

Part 2: Am I correct in my assumption that I will need this line to use a pre-built shared library with another module? Thanks guys (and gals)

III. Exporting headers for prebuilt libraries:

The example above was called ‘naive’ because, in practice, the code in
foo-user.c is going to depend on specific declarations that are normally
found in a header file distributed with the prebuilt library (e.g. “foo.h”).

In other words, foo-user.c is going to have a line like:

include < foo.h >

And you need to provide the header and its include path to the compiler
when building the foo-user module.
A simple way to deal with that is to use exports in the prebuilt module
definition. For example, assuming that a file “foo.h” is located under
the ‘include’ directory relative to the prebuilt module, we can write:

`include $(CLEAR_VARS)

LOCAL_MODULE := foo-prebuilt

LOCAL_SRC_FILES := libfoo.so

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include

include $(PREBUILT_SHARED_LIBRARY)`

The LOCAL_EXPORT_C_INCLUDES definition here ensures that any module that
depends on the prebuilt one will have its LOCAL_C_INCLUDES automatically
prepended with the path to the prebuilt’s include directory, and will thus
be able to find headers inside that.

URL: http://www.srombauts.fr/android-ndk-r5b/docs/PREBUILTS.html

  • 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-05-25T03:44:19+00:00Added an answer on May 25, 2026 at 3:44 am

    The following explanation for the LOCAL_EXPORT_* variables in ANDROID-MK.html in the docs folder of the r6 NDK:

    LOCAL_EXPORT_CFLAGS
    Define this variable to record a set of C/C++ compiler flags that will
    be added to the LOCAL_CFLAGS definition of any other module that uses
    this one with LOCAL_STATIC_LIBRARIES or LOCAL_SHARED_LIBRARIES.

    For example, consider the module ‘foo’ with the following definition:

       include $(CLEAR_VARS)
       LOCAL_MODULE := foo
       LOCAL_SRC_FILES := foo/foo.c
       LOCAL_EXPORT_CFLAGS := -DFOO=1
       include $(BUILD_STATIC_LIBRARY)
    

    And another module, named ‘bar’ that depends on it as:

       include $(CLEAR_VARS)
       LOCAL_MODULE := bar
       LOCAL_SRC_FILES := bar.c
       LOCAL_CFLAGS := -DBAR=2
       LOCAL_STATIC_LIBRARIES := foo
       include $(BUILD_SHARED_LIBRARY)
    

    Then, the flags ‘-DFOO=1 -DBAR=2’ will be passed to the compiler when
    building bar.c

    Exported flags are prepended to your module’s LOCAL_CFLAGS so you can
    easily override them. They are also transitive: if ‘zoo’ depends on
    ‘bar’ which depends on ‘foo’, then ‘zoo’ will also inherit all flags
    exported by ‘foo’.

    Finally, exported flags are not used when building the module that
    exports them. In the above example, -DFOO=1 would not be passed to the
    compiler when building foo/foo.c.

    LOCAL_EXPORT_CPPFLAGS
    Same as LOCAL_EXPORT_CFLAGS, but for C++ flags only.

    LOCAL_EXPORT_C_INCLUDES
    Same as LOCAL_EXPORT_CFLAGS, but for C include paths.
    This can be useful if ‘bar.c’ wants to include headers
    that are provided by module ‘foo’.

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

Sidebar

Related Questions

I'm hoping this question has a very simple answer. I can think of ways
This is a very simple question with a simple answer, but it is not
This is probably a very simple and stupid question to ask, but I have
I am hoping someone can help me. I have a very simple question, but
I'm hoping this is a simple question, as I'm very new to cocoa. I
I'm hoping that this is a VERY simple question, but it's driving me insane!
Very simple question but I am unable to find an answer, I have a
Here's a very simple question. I have an SP that inserts a row into
I have a very simple question. I want to test whether a particular port
This must be a very simple question, but I don't seem to be able

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.