0

I'm having trouble refactoring some make files into manageable modules.

Following is the structure I try to accomplish:

  • jni/Android.mk
  • jni/Application.mk
  • jni/libobj/Android.mk
  • jni/libpng/Android.mk
  • jni/libzip/Android.mk
  • jni/freetype/Android.mk
  • jni/ftgles/Android.mk
  • jni/qcar/Android.mk
  • jni/imagetargets/Android.mk

Note: I started from the Vuforia SDK ImageTargets example and added some other libraries like reading OBJ, PNG and ZIP files. I've also included the freetype and ftgles library.

I call the other make files from my the root Android.mk file

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS) 

include jni/libobj/Android.mk 
include jni/libpng/Android.mk
include jni/libzip/Android.mk
include jni/freetype/Android.mk
include jni/ftgles/Android.mk
include jni/qcar/Android.mk
include jni/imagetargets/Android.mk

You can see all make files in a gist on github.

The compiler gives following error:

Install : libFTGLES.so => libs/armeabi/libFTGLES.so Compile++ arm : ImageTargets <= ImageTargets.cpp jni/imagetargets/ImageTargets.cpp:44:24: fatal error: libpng/png.h: No such file or directory compilation terminated. make: * [obj/local/armeabi/objs/ImageTargets/ImageTargets.o] Error 1

Any idea how to make the libpng (and other modules) headers available for the imagetargets module?

4

1 回答 1

1

我认为在每个子生成文件中指定包含的路径LOCAL_EXPORT_C_INCLUDES将确保在构建最终模块时标题可用。

在 NDK 文档(在您的 NDK 目录中可用)中检查此标志的文档,但据我了解,它将完全按照您的要求执行:自动将每个子模块的包含路径导出到最终模块.

于 2013-05-24T09:59:37.047 回答