开发者

Why LOCAL_CFLAGS += -I$(LOCAL_PATH)/tools/ doesn't work, but LOCAL_CFLAGS += -Ijni/tools/ works properly

开发者 https://www.devze.com 2023-03-13 20:21 出处:网络
I have read all the important ndk documentations to the Android.mk file and can\'t found informations to my problem.

I have read all the important ndk documentations to the Android.mk file and can't found informations to my problem.

Informations to the environment: WinXP(SP3), Cygwin > 1.7, Eclipse 3.6.2, Sequoyah Native Support, ndk-5c, sdk-11, ADT-11

I'll give a small illustration:

  1. The project itself is placed to D:/Projects/mobile/workspace/
  2. Boost (reduced version) is placed to D:/Projects/mobile/workspace/mesf/jni/tools
  3. The simple file "mesf.cpp" holds the #include and the file is placed to D:/Projects/mobile/workspace/mesf/jni/
  4. D:/Projects/mobile/workspace/mesf/jni/Application.mk holds the entry APP_STL := gnustl_static
  5. D:/Projects/mobile/workspace/mesf/jni/Android.mk holds the entry **LOCAL_CFLAGS += -I$(LOCAL_PATH)/tools/ for the boost path.**
  6. Without the specific boost include, it compiles successfully and the source code (as shared object) is debuggable on the target phone remotely.
  7. The console output after ndk-build run: ...-I/cygdrive/d/Projects/mobile/workspace/mesf/jni/tools/ -fexceptions -frtti -DBOOST_THREAD_LINUX -DBOOST_HAS_PTHREADS -D_arm_ -D_REENTRANT -D_GLIBCXX__PTHREADS -DBOOST_HAS_GETTIMEOFDAY -Wa,--noexecstack -fexceptions -frtti -O0 -g
  8. But if I change to LOCAL_CFLAGS += -Ijni/tools/ the #include for boost works!
  9. The console output after ndk-build run: **-Ijni/tools/ -fexceptions -frtti -DBOOST_THREAD_LINUX -DBOOST_HAS_PTHREADS -D_arm_ -D_REENTRANT -D_GLIBCXX__PTHREADS -DBOOST_HAS_GETTIMEOFDAY -Wa,--noexecstack -fexceptions -frtti -O0 -g **
  10. We can see on the consolde output that the path has changed from -I/cygdrive/d/Projects/mobile/workspace/mesf/jni/tools/ to -Ijni/tools/

The recommended method from google is LOCAL_CFLAGS += -I$(LOCAL_PATH)/tools/ (AFAIK), but it doesn't work!

My quest开发者_如何学编程ion, it's a ndk-build, cygwin or Sequoyah bug or a fault by an undefined path variable from me?

Has anybody an idea?


It was a project failure! I've setup a new project with (ndk-5c) including all source content from the old project, and now it works!

0

精彩评论

暂无评论...
验证码 换一张
取 消