【问题标题】:Unknown option error when installing clang libcxx under OSX10.10?OSX10.10下安装clang libcxx时出现未知选项错误?
【发布时间】:2016-07-30 14:35:06
【问题描述】:

最新的 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
clang: warning: argument unused during compilation: '-nostdinc++'
ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我该如何解决?

【问题讨论】:

    标签: c++ c clang llvm-clang


    【解决方案1】:

    OSX 链接器不知道-soname 选项。有几种解决方法(使用install_name,删除makefile,...)请参阅此What is the 'soname' option for building shared libraries for? 和此"ld: unknown option: -soname" on OS X

    【讨论】:

    • 谢谢。我浏览了这两个参考资料,我认为使用install_name 开关可能会解决问题。但是,我想知道如何做到这一点?由于命令是自动执行的,如何将标志 -soname 更改为 -install_name
    • 我不知道 MAC OS,在 linux 上,源代码中有一个 makefile(或带有另一个构建器的构建指令的文件),并使用 make 命令调用它。在这个makefile中还有链接器选项,所以你必须找到makefile并改变它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-15
    • 1970-01-01
    • 2014-04-18
    • 1970-01-01
    相关资源
    最近更新 更多