1

i build a so file in Android.bp,i use the "include_dirs" to find the ".h" file,but it can not find,here is my code

codeA named A.bp

cc_library_static {name :"liba" , static_libs:['libb']}

codeB name B.bp

cc_library_static {name :"libb",include_dirs:['vendor/dirb']}

there is a file named "b.h" in the dir "vendor/dirb"

when i build liba,it got error with "can not find b.h",how to solve it? thank you

1 Answer 1

1

You have to use export_include_dirs in B.bp. But be sure to specify a path relative to B.bp there.

include_dirs is meant to add additional include directories that are not provided by dependent modules.

Note: cc_library_static will create a static library (.a file). Use cc_library_shared instead if you want to have a shared library (.so file).

2
  • hello ,thank you for your advise,but i build "libb",it can build a "libb.a" file, this problem comes when i build "liba"
    – tianyu
    May 13, 2020 at 1:48
  • i changed the "include_dirs" to "export_include_dirs" ,and i solve this problem ,thank you
    – tianyu
    May 13, 2020 at 2:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.