• Lv0
    粉丝0

积分3 / 贡献0

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

编译OpenHarmony-v4.1-Beta1版本失败,报symbol未定义错误,怎么解决?

xinxz1732 显示全部楼层 发表于 2024-3-23 13:23:42
【问题描述】
问题现象和发生的背景
代码拉取:repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v4.1-Beta1 --no-repo-verify

编译命令:./build.sh --product-name rk3568 --ccache --target-cpu arm64

多个log打印的类型不匹配的问题改了,但是又报了如下错误。

相关的代码,截图,日志信息:
[OHOS ERROR] [13452/23372] SOLINK account/os_account/libaccountmgr.z.so
[OHOS ERROR] FAILED: account/os_account/libaccountmgr.z.so lib.unstripped/account/os_account/libaccountmgr.z.so
[OHOS ERROR] /usr/bin/env "../../build/toolchain/gcc_solink_wrapper.py" --readelf="../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-readobj" --nm="../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-nm" --strip=../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-strip   --sofile="./lib.unstripped/account/os_account/libaccountmgr.z.so"  --output="account/os_account/libaccountmgr.z.so" --mini-debug -- ../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++ -shared -Wl,--version-script=../../base/account/os_account/services/accountmgr/libaccountmgr.map -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 -flto=thin -Wl,--thinlto-jobs=8 -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy,cache_size=10\%:cache_size_bytes=10g:cache_size_files=100000 -Wl,--lto-O0 -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 -fsanitize-trap=all -ftrap-function=abort -flto -fsanitize=cfi -fsanitize-cfi-cross-dso -Wl,--version-script=/root/openharmony/build/config/sanitizers/cfi.versionscript -o "./lib.unstripped/account/os_account/libaccountmgr.z.so" @"account/os_account/libaccountmgr.z.so.rsp" -Wl,-soname="libaccountmgr.z.so"
[OHOS ERROR] ld.lld: error: undefined symbol: OHOS::AccountSA::OsAccountInfo::OsAccountInfo(int, std::__h::basic_string<char, std::__h::char_traits<char>, std::__h::allocator<char>>, std::__h::basic_string<char, std::__h::char_traits<char>, std::__h::allocator<char>>, OHOS::AccountSA::OsAccountType, long)
[OHOS ERROR] >>> referenced by inner_os_account_manager.cpp:98 (/root/openharmony/out/rk3568/../../base/account/os_account/services/accountmgr/src/osaccount/inner_os_account_manager.cpp:98)
[OHOS ERROR] >>>               lto.tmpOHOS::AccountSA::IInnerOsAccountManager::CreateBaseStandardAccount())
[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/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR]     return func(*args, **kwargs)
[OHOS ERROR]   File "/root/openharmony/build/hb/modules/ohos_build_module.py", line 67, in run
[OHOS ERROR]     raise exception
[OHOS ERROR]   File "/root/openharmony/build/hb/modules/ohos_build_module.py", line 65, in run
[OHOS ERROR]     super().run()
[OHOS ERROR]   File "/root/openharmony/build/hb/modules/interface/build_module_interface.py", line 72, in run
[OHOS ERROR]     raise exception
[OHOS ERROR]   File "/root/openharmony/build/hb/modules/interface/build_module_interface.py", line 70, in run
[OHOS ERROR]     self._target_compilation()
[OHOS ERROR]   File "/root/openharmony/build/hb/modules/ohos_build_module.py", line 103, in _target_compilation
[OHOS ERROR]     self.target_compiler.run()
[OHOS ERROR]   File "/root/openharmony/build/hb/services/ninja.py", line 38, in run
[OHOS ERROR]     self._execute_ninja_cmd()
[OHOS ERROR]   File "/root/openharmony/build/hb/services/ninja.py", line 69, in _execute_ninja_cmd
[OHOS ERROR]     SystemUtil.exec_command(
[OHOS ERROR]   File "/root/openharmony/build/hb/util/system_util.py", line 64, in exec_command
[OHOS ERROR]     LogUtil.get_failed_log(log_path)
[OHOS ERROR]   File "/root/openharmony/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/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/out/rk3568/error.log, and for more build information in /root/openharmony/out/rk3568/build.log




我尝试过的解决方法和结果:
试着加了头文件引用,还是一样的报错



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

精彩评论7

s_hao

沙发 发表于 2024-3-28 14:17:22
可以试试32位的编译,64位的编译没有人去看护,会有不少编译问题

xinxz1732

发表于 2024-3-29 19:06  IP属地: 山东省潍坊市

回复 s_hao: 谢谢,主要是目前需要用到64验证环境,64为编译问题确实比较多

s_hao

发表于 2024-4-1 10:08  IP属地: - 中国广东省广州市 中国电信IDC

回复 xinxz1732: https://gitee.com/openharmony/account_os_account/pulls/1719
可以看下这个,这周也会正式进行合入

【2 条回复】

深开鸿_胡瑞涛

板凳 发表于 2024-3-28 17:59:42
试试编译默认的32位的镜像吧

xinxz1732

发表于 2024-3-29 19:08  IP属地: 山东省潍坊市

回复 深开鸿_胡瑞涛: 32位的编译没问题,64为的4.0编译也能通过,4.1的问题很多。

【1 条回复】

小~Q

地板 发表于 2024-4-1 09:10:53
在4.1Release已经修复了,

zhikai

发表于 2024-9-5 14:38  IP属地: 江苏省扬州市

回复 小~Q: 但是我用镜像网站下载的源码编译64位还是有问题啊

【1 条回复】
共7 条回复,点击查看

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

返回顶部