openharmony3.0头文件问题

我在code-3.0源码上编译oled例程时发现,build.gn中include头文件路径并不正确,但是能够编译成功,后来我干脆把include包含的头文件路径全删了,编译还是能够成功。

我又在code-1.0源码上尝试同样的操作,编译报错。

openharmony源码中头文件是怎样引用的,问啥在code-3.0中删除了build.gn中的头文件也能正常编译?

问题求助
2022-01-12 10:30:23
浏览
1
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
鸿蒙开发初学者
1

搞清楚了,在code-3.0中由config.gni为开发板编译相关的配置,编译时会采用该配置文件中的参数编译所有OS组件,编译阶段系统全局可见。在config.gni中包含了很多头文件,常用的基本包含在内了,如下所示:

# Board related headfiles search path.
board_include_dirs = [
  "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/include",
  "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/include",
  "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/system/include",
  "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/config",
  "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/config/nv",
  "${ohos_root_path}utils/native/lite/include",
  "${ohos_root_path}device/hisilicon/hispark_pegasus/hi3861_adapter/kal/cmsis",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/kernel/base/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/kernel/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/arch/risc-v/rv32im",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libm/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libsec/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/net/wpa_supplicant-2.7/src/common",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/plat/riscv",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/kernel/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/kernel/extended/runstop",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/posix/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/linux/include",
  "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/third_party/lwip_sack/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/musl/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/musl/arch/generic",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/musl/arch/riscv32",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/hw/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/nuttx/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libsec/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/config",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/user",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/plat",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/extend/include",
  "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/arch",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/bionic/libm",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/shell/include",
 "${ohos_root_path}device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/net/telnet/include",
]

分享
微博
QQ
微信
回复
2022-01-12 13:04:15
相关问题
HiSpark_IPC_DIY 摄像烧录失败
1915浏览 • 2回复 待解决
请问下鸿蒙的webview如何设置请求
2002浏览 • 1回复 待解决
openHarmony2.0 hb编译问题
3965浏览 • 3回复 待解决
openharmony 3.0LTS 中liteos-a支持I2S输出吗
2259浏览 • 1回复 待解决
openHarmony 注册服务中的语法问题
2560浏览 • 1回复 待解决
openharmony编译安装hb前遇到这问题
1845浏览 • 1回复 待解决
js开发上传文件路径问题
1891浏览 • 2回复 待解决
DevEco Studio 配置Openharmony SDK时npm问题
3924浏览 • 1回复 待解决
寻找鸿蒙系统灯控设备、鸿蒙摄像
1828浏览 • 2回复 待解决
DevEco安装的3.0无法创建JS Visual?
1429浏览 • 1回复 待解决