关于C_INCLUDES must be under the source or output directories

之前在Android N上的项目,正常编译,挪到O项目,就报这个异常,很是疑惑。

直接翻译过来,就是被include的目录,必须在源码或者输出的目录内。

Google一翻:

There are a couple of other things that can trigger this check -- I've seen both of these in practice:

1. Using $(VAR)/include in your LOCAL_C_INCLUDES, but when VAR isn't set. The build system then gets "/include", and before this check would attempt to look at the filesystem in that location. If that happened to be present on a machine, it could end up using that inappropriately.

即你配置的变量,在编译时并没定义,为空,所以变成错误的路径了。

2. Using an absolute path to a directory within the source path. This happens when someone overzealously uses $(abspath) or similar. Instead, make sure that all of your paths are relative paths from the top of the source tree. During a build, the working directory is always at the top of the source tree.

你使用了绝对路径,导致这个警告,你应该使用相对路径。

查了自己的Android.mk,发现一个定义正好是2的情况:

 LOCAL_PATH := $(call my-dir)
#TEST_PATH := $(shell pwd)/$(LOCAL_PATH) //原来配置的路径,为绝对路径
 TEST_PATH := $(LOCAL_PATH)/Other

修改之后,编译正常了。这边记录下,防止类似错误。。

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值