clang-10:错误:链接器命令失败,退出代码为1(使用-v查看调用)

时间:2020-07-31 04:10:43

标签: cmake clang

我正在使用clang10和cmake版本3.15.3。当我用HelloWorld代码进行测试时,我得到了以下错误。 有人可以帮我吗?

bash-4.2# cmake -GNinja ..
-- Configuring done
-- Generating done
-- Build files have been written to: /root/cmake-hello-world/build
bash-4.2# ninja
[1/1] Linking CXX executable CMakeHelloWorld
FAILED: CMakeHelloWorld
: && /usr/bin/clang++  -m32  -m32  -rdynamic  -O3 -g -fuse-ld=lld -Xlinker -error-limit=1 -fsanitize=address -fsanitize=undefined -fstack-protector-strong CMakeFiles/CMakeHelloWorld.dir/HelloWorld.cpp.o  -o CMakeHelloWorld  Hello/libHello.a && :
ld.lld: error: asan_malloc_linux.cpp:(.debug_loc+0x1C938D): has non-ABS relocation R_386_GOTOFF against symbol 'alloc_memory_for_dlsym'
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

0 个答案:

没有答案