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

tianyu
  • 119
  • 1
  • 10

1 Answers1

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).

Simpl
  • 1,938
  • 1
  • 10
  • 21
  • 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 '20 at 01:48
  • i changed the "include_dirs" to "export_include_dirs" ,and i solve this problem ,thank you – tianyu May 13 '20 at 02:36