系统版本:4.0 release

将foundation/graphic/graphic_2d/rosen/samples/composer/hello_composer.cpp添加到编译流程中,出现编译报错。求助这个报错应如何处理。

[OHOS ERROR] [2433/3001] CXX obj/foundation/graphic/graphic_2d/rosen/samples/composer/hello_composer/hello_composer.o
[OHOS ERROR] FAILED: obj/foundation/graphic/graphic_2d/rosen/samples/composer/hello_composer/hello_composer.o 
[OHOS ERROR] /usr/bin/ccache ../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++ -MMD -MF obj/foundation/graphic/graphic_2d/rosen/samples/composer/hello_composer/hello_composer.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 -DACE_ENABLE_GPU -DACE_ENABLE_GL -DRS_ENABLE_GL -DRS_DISABLE_EGLIMAGE -DRS_ENABLE_PARALLEL_RENDER -Iobj/third_party/musl/usr/include/aarch64-linux-ohos -Ioverride/third_party -I../.. -Igen -I../../foundation/graphic/graphic_2d/rosen/modules/composer/hdi_backend/include -I../../foundation/graphic/graphic_2d/rosen/include/common -I../../foundation/graphic/graphic_2d/rosen/modules/composer/vsync/include -I../../foundation/graphic/graphic_2d/rosen/modules/render_service_base/src -I../../foundation/graphic/graphic_2d/interfaces/inner_api/composer -I../../foundation/communication/ipc/interfaces/innerkits/ipc_core/include -I../../commonlibrary/c_utils/base/include -I../../third_party/bounds_checking_function/include -I../../foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include -I../../base/notification/eventhandler/interfaces/inner_api -I../../base/notification/eventhandler/frameworks/eventhandler/include -I../../foundation/graphic/graphic_2d/utils/socketpair/export -I../../base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include -I../../base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/encode/include -I../../foundation/communication/dsoftbus/interfaces/kits -I../../foundation/communication/dsoftbus/interfaces/kits/bus_center -I../../foundation/communication/dsoftbus/interfaces/kits/common -I../../foundation/communication/dsoftbus/interfaces/kits/discovery -I../../foundation/communication/dsoftbus/interfaces/kits/transport -I../../foundation/communication/dsoftbus/sdk/transmission/session/cpp/include -I../../foundation/communication/dsoftbus/interfaces/inner_kits/transport -I../../foundation/communication/dsoftbus/core/common/dfx/hisysevent_adapter/include -I../../foundation/graphic/graphic_2d/interfaces/inner_api/surface -I../../foundation/graphic/graphic_2d/interfaces/inner_api/common -I../../foundation/graphic/graphic_2d/utils/sandbox -I../../foundation/graphic/graphic_2d/utils/buffer_handle/export -I../../drivers/peripheral/base -I../../foundation/graphic/graphic_2d/utils/scoped_bytrace/export -I../../drivers/peripheral/display/interfaces/include -I../../drivers/peripheral/display/hdi_service/gralloc/include -I../../foundation/graphic/graphic_2d/utils/sync_fence/export -I../../base/hiviewdfx/hilog/interfaces/native/innerkits -I../../foundation/graphic/graphic_2d/utils/log -I../../base/hiviewdfx/hilog/interfaces/native/innerkits/include -fno-strict-aliasing -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -ffunction-sections -fno-short-enums --target=aarch64-linux-ohos -march=armv8-a -mfloat-abi=hard -mfpu=neon-fp-armv8 --param=ssp-buffer-size=4 -fstack-protector-strong -fPIC -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=implicit-fallthrough -Wno-error=sizeof-array-div -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=abstract-final-class -Wno-error=sign-compare -Wno-error=int-in-bool-context -Wno-error=xor-used-as-pow -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-undefined-var-template -Wno-nonportable-include-path -Wno-user-defined-warnings -Wno-unused-lambda-capture -Wno-null-pointer-arithmetic -Wno-enum-compare-switch -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g2 -ggnu-pubnames -fno-common -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare --param=ssp-buffer-size=4 -fstack-protector-ret-strong -fPIE -Wall -Werror -g3 -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -Wno-error=deprecated-declarations -std=c++17 -fno-exceptions -fno-rtti --sysroot=obj/third_party/musl -fvisibility-inlines-hidden -c ../../foundation/graphic/graphic_2d/rosen/samples/composer/hello_composer.cpp -o obj/foundation/graphic/graphic_2d/rosen/samples/composer/hello_composer/hello_composer.o
[OHOS ERROR] ../../foundation/graphic/graphic_2d/rosen/samples/composer/hello_composer.cpp:77:22: error: no matching constructor for initialization of 'OHOS::Rosen::VSyncReceiver'
[OHOS ERROR]     g_receiver = new VSyncReceiver(vsyncConnection, mainThreadHandler_);
[OHOS ERROR]                      ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[OHOS ERROR] ../../foundation/graphic/graphic_2d/interfaces/inner_api/composer/vsync_receiver.h:66:5: note: candidate constructor not viable: no known conversion from 'std::shared_ptr<OHOS::AppExecFwk::EventHandler>' to 'const sptr<OHOS::IRemoteObject>' for 2nd argument
[OHOS ERROR]     VSyncReceiver(const sptr<IVSyncConnection>& conn,
[OHOS ERROR]     ^
[OHOS ERROR] ../../foundation/graphic/graphic_2d/interfaces/inner_api/composer/vsync_receiver.h:72:5: note: candidate constructor not viable: requires 1 argument, but 2 were provided
[OHOS ERROR]     VSyncReceiver(const VSyncReceiver &) = delete;
[OHOS ERROR]     ^
[OHOS ERROR] ../../foundation/graphic/graphic_2d/rosen/samples/composer/hello_composer.cpp:467:14: error: variable 'clientCount' set but not used [-Werror,-Wunused-but-set-variable]
[OHOS ERROR]     uint32_t clientCount = 0;
[OHOS ERROR]              ^
[OHOS ERROR] 2 errors generated.
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/services/ninja.py", line 49, in _execute_ninja_cmd
[OHOS ERROR]     SystemUtil.exec_command(
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/util/system_util.py", line 63, in exec_command
[OHOS ERROR]     raise OHOSException(
[OHOS ERROR] exceptions.ohos_exception.OHOSException: Please check build log in /home/openharmony/4.0_Release/out/rk3588/build.log
[OHOS ERROR] 
[OHOS ERROR] During handling of the above exception, another exception occurred:
[OHOS ERROR] 
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR]     return func(*args, **kwargs)
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/modules/ohos_build_module.py", line 67, in run
[OHOS ERROR]     raise exception
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/modules/ohos_build_module.py", line 65, in run
[OHOS ERROR]     super().run()
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/modules/interface/build_module_interface.py", line 72, in run
[OHOS ERROR]     raise exception
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/modules/interface/build_module_interface.py", line 70, in run
[OHOS ERROR]     self._target_compilation()
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation
[OHOS ERROR]     self.target_compiler.run()
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/services/ninja.py", line 38, in run
[OHOS ERROR]     self._execute_ninja_cmd()
[OHOS ERROR]   File "/home/openharmony/4.0_Release/build/hb/services/ninja.py", line 52, in _execute_ninja_cmd
[OHOS ERROR]     raise OHOSException('ninja phase failed', '4000')
[OHOS ERROR] exceptions.ohos_exception.OHOSException: ninja phase failed
[OHOS ERROR] 
[OHOS ERROR] Code:      4000
[OHOS ERROR] 
[OHOS ERROR] Reason:    ninja phase failed
[OHOS ERROR] 
[OHOS ERROR] Solution:  Please check the compile log at out/{compiling product}/build.log, If you could analyze build logs. 
[OHOS ERROR] 		Or you can try the following steps to solve this problem:
[OHOS ERROR] 		  1. cd to OHOS root path
[OHOS ERROR] 		  2. run 'hb clean --all' or 'rm -rf out build/resources/args/*.json'.
[OHOS ERROR] 		  3. repo sync
[OHOS ERROR] 		  4. repo forall -c 'git lfs pull'
[OHOS ERROR] 		  5. bash build/prebuilts_download.sh
[OHOS ERROR] 		  6. rebuild your product or component
[OHOS ERROR] 
[OHOS ERROR] 		If you still cannot solve this problem, you could post this problem on: 
[OHOS ERROR] 		  https://gitee.com/openharmony/build/issues
[OHOS ERROR]

 

Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐