讨论广场 问答详情
openharmony 6.0代码编译报错
OH百川 2025-10-14 17:24:27
330 评论 分享

[56292/95733] CXX obj/device/soc/rockchip/rk3568/hardware/display/src/display_device/libdisplay_composer_vdi_impl/display_composer_vdi_impl.o

FAILED: obj/device/soc/rockchip/rk3568/hardware/display/src/display_device/libdisplay_composer_vdi_impl/display_composer_vdi_impl.o

/usr/bin/ccache ../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++ -MMD -MF obj/device/soc/rockchip/rk3568/hardware/display/src/display_device/libdisplay_composer_vdi_impl/display_composer_vdi_impl.o.d -DV8_DEPRECATION_WARNINGS -D_GNU_SOURCE -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCOMPONENT_BUILD -D__GNU_SOURCE=1 -DCHROMIUM_CXX_TWEAK_INLINES -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DOHOS_PLATFORM -I../../device/soc/rockchip/rk3568/hardware/display/src/display_device -I../../drivers/peripheral/display/utils/include -I../../drivers/interface/display/composer -I../../drivers/peripheral/display/composer/hdi_service/include -I../../drivers/interface/display/composer/hdifd_parcelable -Iobj/third_party/musl/usr/include/arm-linux-ohos -Ioverride/third_party -I../.. -Igen -I../../commonlibrary/c_utils/base/include -I../../foundation/communication/ipc/interfaces/innerkits/ipc_core/include -I../../third_party/bounds_checking_function/include -Igen/drivers/interface -Igen/drivers/interface/display/composer -I../../drivers/hdf_core/adapter/uhdf2/ipc/include -I../../drivers/hdf_core/interfaces/inner_api/utils -I../../drivers/hdf_core/interfaces/inner_api/osal/uhdf -I../../drivers/hdf_core/interfaces/inner_api/hdi -I../../foundation/graphic/graphic_surface/interfaces/inner_api/utils -I../../base/hiviewdfx/hilog/interfaces/native/innerkits/include -I../../foundation/communication/ipc/dl_deps -I../../foundation/communication/ipc/ipc/native/src/core/dbinder/include -I../../foundation/communication/ipc/ipc/native/src/core/framework/include -I../../foundation/communication/ipc/ipc/native/src/core/invoker/include -fno-strict-aliasing -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -flto=thin -fsplit-lto-unit -ffunction-sections -fno-short-enums --target=arm-linux-ohos -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a -fstack-protector-strong -mfpu=neon -mthumb -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-error=c99-designator -Wno-error=anon-enum-enum-conversion -Wno-error=sizeof-array-div -Wno-error=implicit-fallthrough -Wno-error=reorder-init-list -Wno-error=range-loop-construct -Wno-error=deprecated-copy -Wno-error=implicit-int-float-conversion -Wno-error=inconsistent-dllimport -Wno-error=unknown-warning-option -Wno-error=sign-compare -Wno-error=int-in-bool-context -Wno-error=return-stack-address -Wno-error=dangling-gsl -Wno-unused-but-set-variable -Wno-deprecated-declarations -Wno-unused-but-set-parameter -Wno-null-pointer-subtraction -Wno-unqualified-std-cast-call -Wno-user-defined-warnings -Wno-unused-lambda-capture -Wno-null-pointer-arithmetic -Wno-enum-compare-switch -O2 -fno-ident -fdata-sections -ffunction-sections -fomit-frame-pointer -gdwarf-3 -g2 -ggnu-pubnames -fno-common -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -DCONFIG_STANDARD_SYSTEM -DBUILD_PUBLIC_VERSION -std=c++17 -fno-exceptions -fno-rtti --sysroot=obj/third_party/musl -fvisibility-inlines-hidden -c ../../device/soc/rockchip/rk3568/hardware/display/src/display_device/display_composer_vdi_impl.cpp -o obj/device/soc/rockchip/rk3568/hardware/display/src/display_device/libdisplay_composer_vdi_impl/display_composer_vdi_impl.o

In file included from ../../device/soc/rockchip/rk3568/hardware/display/src/display_device/display_composer_vdi_impl.cpp:16:

In file included from ../../device/soc/rockchip/rk3568/hardware/display/src/display_device/display_composer_vdi_impl.h:22:

In file included from ../../drivers/peripheral/display/composer/hdi_service/include/idisplay_composer_vdi.h:22:

../../drivers/interface/display/composer/v1_3/include/idisplay_composer_interface.h:20:10: fatal error: 'v1_3/display_composer_type.h' file not found

#include "v1_3/display_composer_type.h"

         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

在drivers/interface/display/composer/v1_3/include/idisplay_composer_interface.h文件中引用了v1_3/display_composer_type.h,该文件是由idl语法生成h文件,v1_1,v1_2都是可以正常编译处理啊的,为啥子v1_3编译失败

330 评论 分享
写回答
全部评论(6)

请问楼主这个问题解决了吗,我发现先不include v1_3/display_composer_type.h就会生成v1_3/display_composer_type.h,否则就直接报错中断了,看起来是时序有问题

2025-12-24 19:56:58
引用:“确保代码是完整的,可以试试重编,就是时序问题,要加 -j n才是多线程”
好的,感谢楼主,但是试了很多遍还是这样,跳过这个报错之后还有其他类似event_filter.h找不到的报错,感觉是一样的原因....
2025-12-25 09:21:41
引用:“我的编译命令是./build.sh --product-name rk3568 --ccache,是默认多线程的吗”
确保代码是完整的,可以试试重编,就是时序问题,要加 -j n才是多线程
2025-12-25 09:04:08
引用:“idl->HDI生成h文件,如果你编译参数加了多线程,那么去掉”
我的编译命令是./build.sh --product-name rk3568 --ccache,是默认多线程的吗
2025-12-25 08:26:55
2025-12-24 20:26:20
idl->HDI生成h文件,如果你编译参数加了多线程,那么去掉
2025-12-24 20:26:20

v1_3/display_composer_type.h 本应是由 idl_tool 工具在编译阶段自动生成的文件,
但在当前 build pipeline 中,它没有生成或生成目录不被 include

看一下out目录下是否生成了下面三个文件
v1_1/display_composer_type.h
v1_2/display_composer_type.h
v1_3/display_composer_type.h

确认 .idl 存在
确认 BUILD.gn 声明
v1_3 应该与 v1_2 的结构保持完全一致,只是版本号变更

2025-10-15 16:13:46