最新的 llvm-clang 已安装(我在 ~/目录下构建源)。
我正在尝试安装标准库 libc++。 执行成功后
svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
我跑了
./buildit
下
~/llvm-clang/libcxx/lib
但是,我得到了一个错误:
+ clang algorithm.o any.o bind.o chrono.o condition_variable.o debug.o exception.o future.o hash.o ios.o iostream.o locale.o memory.o mutex.o new.o optional.o random.o regex.o shared_mutex.o stdexcept.o string.o strstream.o system_error.o thread.o typeinfo.o utility.o valarray.o -fPIC -o libc++.so.1.0 -shared -nodefaultlibs -Wl,-soname,libc++.so.1 -lpthread -lrt -lc -lstdc++ -nostdinc++ -std=c++11 -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion -Wstrict-aliasing=2 -Wstrict-overflow=4<br/>
clang: warning: argument unused during compilation: '-nostdinc++'<br/>
ld: unknown option: -soname<br/>
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我该如何解决?
最佳答案
OSX 链接器不知道 -soname
选项。有几种变通方法(使用 install_name
,删除 makefile,...)参见 What is the 'soname' option for building shared libraries for?还有这个"ld: unknown option: -soname" on OS X
关于c++ - OSX10.10下安装clang libcxx时报Unknown option error?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36514686/