HarmonyOS 鸿蒙Next mac m1 cjc 编译错误

发布于 1周前 作者 phonegap100 来自 鸿蒙OS

HarmonyOS 鸿蒙Next mac m1 cjc 编译错误

cjc -V hello.cj                                                    
Cangjie Compiler: 0.53.5 (cjnative)
Target: aarch64-apple-darwin
’/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/bin/cjc-frontend’ ‘-V’ ‘/Users/xxxx/work/private/code/Cangjie-2/hello.cj’ ‘-o’ ‘/private/var/folders/50/bqsyj4s52tb88nl51zqgf3vm0000gn/T/cangjie-tmp-23kYt9HZGyY-d03d4618/hello.bc’
info: selected Darwin SDK path: / (SDK Version: N/A)
LD_LIBRARY_PATH=’/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/third_party/llvm/bin/…/lib’:$DYLD_LIBRARY_PATH ‘/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/third_party/llvm/bin/opt’ ‘/private/var/folders/50/bqsyj4s52tb88nl51zqgf3vm0000gn/T/cangjie-tmp-23kYt9HZGyY-d03d4618/hello.bc’ ‘-passes=default<O0>’ ‘–cangjie-pipeline’ ‘-o’ ‘/private/var/folders/50/bqsyj4s52tb88nl51zqgf3vm0000gn/T/cangjie-tmp-23kYt9HZGyY-d03d4618/hello.opt.bc’
LD_LIBRARY_PATH=’/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/third_party/llvm/bin/…/lib’:$DYLD_LIBRARY_PATH ‘/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/third_party/llvm/bin/llc’ ‘/private/var/folders/50/bqsyj4s52tb88nl51zqgf3vm0000gn/T/cangjie-tmp-23kYt9HZGyY-d03d4618/hello.opt.bc’ ‘–cangjie-pipeline’ ‘-disable-debug-info-print’ ‘–relocation-model=pic’ ‘–frame-pointer=all’ ‘–stack-trace-format=default’ ‘–cj-stack-grow=false’ ‘-O0’ ‘–filetype=obj’ ‘-o’ ‘/private/var/folders/50/bqsyj4s52tb88nl51zqgf3vm0000gn/T/cangjie-tmp-23kYt9HZGyY-d03d4618/hello.o’
‘CacheCopy’ ‘/private/var/folders/50/bqsyj4s52tb88nl51zqgf3vm0000gn/T/cangjie-tmp-23kYt9HZGyY-d03d4618/hello.o’ ‘/Users/xxxx/work/private/code/Demo2/.cached/fc0b627983ca585b.o’
‘/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/third_party/llvm/bin/ld64.lld’ ‘-o’ ‘/Users/xxxx/work/private/code/Demo2/main’ ‘-arch’ ‘arm64’ ‘-platform_version’ ‘macos’ ‘12.0.0’ ‘12’ ‘-syslibroot’ ‘/’ ‘-pie’ ‘-L/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/runtime/lib/darwin_aarch64_llvm’ ‘-L/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/lib/darwin_aarch64_llvm’ ‘/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/lib/darwin_aarch64_llvm/section.o’ ‘/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/lib/darwin_aarch64_llvm/cjstart.o’ ‘/private/var/folders/50/bqsyj4s52tb88nl51zqgf3vm0000gn/T/cangjie-tmp-23kYt9HZGyY-d03d4618/hello.o’ ‘/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/lib/darwin_aarch64_llvm/libcangjie-std-core.a’ ‘-lcangjie-runtime’ ‘-lsecurec’ ‘-lSystem’ ‘/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/lib/darwin_aarch64_llvm/libclang_rt.osx.a’ ‘-rpath’ ‘/Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/runtime/lib/darwin_aarch64_llvm’
ld64.lld: error: library not found for -lSystem
ld64.lld: error: undefined symbol: ___stack_chk_fail
>>> referenced by section.cpp:0 (/Users/leon/JenkinsWorkSpace/workspace/Mac_AArch64_SDK_Version_Build_Daily/cangjie/third_party/runtime/src/Arch_os/Aarch64_macos/section.cpp:0)
>>> /Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/lib/darwin_aarch64_llvm/section.o:(symbol _InitData+0x280)
>>> referenced by /Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/lib/darwin_aarch64_llvm/libcangjie-std-core.a(atexit.c.o):(symbol _CJ_CORE_AtExitCallbackListLock+0x54)
>>> referenced by /Users/xxxx/.cangjie-sdk/5.0/cangjie/compiler/lib/darwin_aarch64_llvm/libcangjie-std-core.a(atexit.c.o):(symbol _CJ_CORE_AtExitCallbackListUnlook+0x4c)
>>> referenced 39 more times


关于HarmonyOS 鸿蒙Next mac m1 cjc 编译错误的问题,您也可以访问:https://www.itying.com/category-93-b0.html 联系官网客服。

2 回复

有要学HarmonyOS AI的同学吗,联系我:https://www.itying.com/goods-1206.html

这个错误是链接错误,ld64.lld找不到-lSystem库。同时,还有一个undefined symbol错误,是由于section.cpp中的一个未定义符号被引用。这个错误可能是由于缺少某些库或库路径设置不正确引起的。建议检查库路径是否正确,是否缺少必要的库文件,并确保库文件与目标架构兼容。
回到顶部