老师,我把生成二进制为文件链接成可执行文件出现了错误,运行JIT可以正常执行。
错误日志打印在下面,老师有空看下
➜ cmake-build-debug git:(master) ✗ clang -v bin/output.o -o a.out
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
"/usr/bin/ld" -demangle -lto_library /usr/local/Cellar/llvm/9.0.0/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.14.0 -o a.out bin/output.o -lSystem /usr/local/Cellar/llvm/9.0.0/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
(maybe you meant: ___main)
ld: symbol(s) not found for architecture x86_64
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
展开