• Lv0
    粉丝0

积分7 / 贡献0

提问1答案被采纳0文章0

作者动态

    hb build --target-cpu arm64 -f报错,怎么处理???

    qinweijunlin 显示全部楼层 发表于 2024-5-8 22:22:05
    hb env
    ==========================================
    [OHOS INFO] Necessary package: bison, ccache, default-jdk, flex, gcc-arm-none-eabi, genext2fs, libelf-dev, liblz4-tool, libssl-dev, libtinfo5, mtd-utils, mtools, openssl, ruby, scons, u-boot-tools, unzip, zip
    [OHOS INFO] Installed package: bison, ccache, default-jdk, flex, gcc-arm-none-eabi, genext2fs, libelf-dev, liblz4-tool, libssl-dev, libtinfo5, mtd-utils, mtools, openssl, ruby, scons, u-boot-tools, unzip, zip
    [OHOS INFO] Uninstalled package:
    [OHOS INFO] root path: /root/openharmony-4.1
    [OHOS INFO] board: rk3568
    [OHOS INFO] kernel: None
    [OHOS INFO] product: rk3568
    [OHOS INFO] product path: /root/openharmony-4.1/vendor/hihope/rk3568
    [OHOS INFO] device path: /root/openharmony-4.1/device/board/rockchip/rk3568
    [OHOS INFO] device company: rockchip
    ==========================================


    hb build --target-cpu arm64 -f
    ==========================================
    [OHOS INFO] [45073/48409] SOLINK multimedia/media_library/libmedia_library.z.so

    [OHOS ERROR] [45071/48409] LINK tests/unittest/distributed_notification_service/unittest/notification_service_test
    [OHOS ERROR] FAILED: tests/unittest/distributed_notification_service/unittest/notification_service_test exe.unstripped/tests/unittest/distributed_notification_service/unittest/notification_service_test
    [OHOS ERROR] /usr/bin/env "../../build/toolchain/gcc_link_wrapper.py" --output="tests/unittest/distributed_notification_service/unittest/notification_service_test" --strip="../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-strip" --unstripped-file="./exe.unstripped/tests/unittest/distributed_notification_service/unittest/notification_service_test" --clang-base-dir="/root/openharmony-4.1/prebuilts/clang/ohos"  --mini-debug -- ../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++ -Wl,--pack-dyn-relocs=android+relr -Wl,--fatal-warnings -Wl,--build-id=md5 -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,-z,max-page-size=4096 -Wl,--icf=all -Wl,--color-diagnostics -Wl,--no-undefined -Wl,--exclude-libs=libunwind_llvm.a -Wl,--exclude-libs=libc++_static.a -Wl,--exclude-libs=libvpx_assembly_arm.a --target=aarch64-linux-ohos -Wl,--hash-style=gnu -march=armv8-a -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Werror -Wl,--warn-shared-textrel -Wl,-O2 -Wl,--gc-sections -Wl,--gdb-index --sysroot=obj/third_party/musl -nostdlib -Lobj/third_party/musl/usr/lib/aarch64-linux-ohos -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos -Wl,--warn-shared-textrel -Bdynamic -Wl,-z,nocopyreloc -pie -o "./exe.unstripped/tests/unittest/distributed_notification_service/unittest/notification_service_test" obj/third_party/musl/usr/lib/aarch64-linux-ohos/Scrt1.o obj/third_party/musl/usr/lib/aarch64-linux-ohos/crti.o -Wl,--start-group  @"tests/unittest/distributed_notification_service/unittest/notification_service_test.rsp"  -lunwind ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos/libclang_rt.builtins.a -lc++ -lc ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos/libc++abi.a ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos/libclang_rt.gwp_asan.a -ldl -lm -Wl,--end-group  obj/third_party/musl/usr/lib/aarch64-linux-ohos/crtn.o
    [OHOS ERROR] ld.lld: error: undefined symbol: OHOS::Notification::NotificationConstant::NO_DELAY_DELETE_TIME
    [OHOS ERROR] >>> referenced by gtest.h:1402 (../../third_party/googletest/googletest/include/gtest/gtest.h:1402)
    [OHOS ERROR] >>>               obj/base/notification/distributed_notification_service/services/ans/test/unittest/notification_service_test/advanced_notification_service_test.oOHOS::Notification::AdvancedNotificationServiceTest_StartArchiveTimer_00001_Test::TestBody())
    [OHOS ERROR] >>> referenced by gtest.h:1402 (../../third_party/googletest/googletest/include/gtest/gtest.h:1402)
    [OHOS ERROR] >>>               obj/base/notification/distributed_notification_service/services/ans/test/unittest/notification_service_test/advanced_notification_service_test.oOHOS::Notification::AdvancedNotificationServiceTest_StartArchiveTimer_00001_Test::TestBody())
    [OHOS ERROR] clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

    [OHOS ERROR] Traceback (most recent call last):
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/containers/status.py", line 47, in wrapper
    [OHOS ERROR]     return func(*args, **kwargs)
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/modules/ohos_build_module.py", line 67, in run
    [OHOS ERROR]     raise exception
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/modules/ohos_build_module.py", line 65, in run
    [OHOS ERROR]     super().run()
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/modules/interface/build_module_interface.py", line 72, in run
    [OHOS ERROR]     raise exception
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/modules/interface/build_module_interface.py", line 70, in run
    [OHOS ERROR]     self._target_compilation()
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation
    [OHOS ERROR]     self.target_compiler.run()
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/services/ninja.py", line 38, in run
    [OHOS ERROR]     self._execute_ninja_cmd()
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/services/ninja.py", line 69, in _execute_ninja_cmd
    [OHOS ERROR]     SystemUtil.exec_command(
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/util/system_util.py", line 64, in exec_command
    [OHOS ERROR]     LogUtil.get_failed_log(log_path)
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/util/log_util.py", line 193, in get_failed_log
    [OHOS ERROR]     LogUtil.get_compiler_failed_log(log_path)
    [OHOS ERROR]   File "/root/openharmony-4.1/build/hb/util/log_util.py", line 180, in get_compiler_failed_log
    [OHOS ERROR]     raise OHOSException(
    [OHOS ERROR] exceptions.ohos_exception.OHOSException: COMPILE Failed! Please check error in /root/openharmony-4.1/out/rk3568/error.log, and for more build information in /root/openharmony-4.1/out/rk3568/build.log
    [OHOS ERROR]

    [OHOS ERROR] Code:        4000
    [OHOS ERROR]
    [OHOS ERROR] Reason:      COMPILE Failed! Please check error in /root/openharmony-4.1/out/rk3568/error.log, and for more build information in /root/openharmony-4.1/out/rk3568/build.log
    [OHOS ERROR]
    [OHOS ERROR] Error Type:  Ninja build error
    [OHOS ERROR]
    [OHOS ERROR] Description: An unknown error occurred while executing 'ninja -C'.
    [OHOS ERROR]
    [OHOS ERROR] Solution:    no solution
    [OHOS ERROR]
    ==========================================

    您尚未登录,无法参与评论,登录后可以:
    参与开源共建问题交流
    认同或收藏高质量问答
    获取积分成为开源共建先驱

    精彩评论2

    润开鸿_闻飞

    沙发 发表于 2024-5-10 15:56:15
    可以尝试使用下面的命令编译

    润开鸿_闻飞

    板凳 发表于 2024-5-10 15:56:33
    可以尝试使用下面的命令编译
    rm out -rf; clear; ./build.sh --product-name rk3568 --ccache --target-cpu arm64

    Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

    返回顶部