【发布时间】:2020-01-30 03:44:09
【问题描述】:
clang++ ... foo.cpp ... -o dir1/foo.o
clang++ ... foo.cpp ... -o dir2/foo.o
//The only difference beween the above two clang++ command lines
//is the output directory
llvm-ar ... dir1/lib1.a ... dir1/foo.o ...
llvm-ar ... dir2/lib2.a ... dir2/foo.o ...
clang++ ... dir1/lib1.a dir2/lib2.a ... -o lib.so
生成 lib.so 时 foo.cpp 中的重复符号会发生什么情况?是否需要任何标志才能不产生符号重复错误?
【问题讨论】:
标签: c++ clang static-linking