【发布时间】:2015-08-13 12:42:28
【问题描述】:
我有以下问题:
我有一个名为libAlgatorc.a 的静态库和三个名为SortingAbsAlgorithm.cpp、SortingTestCase.cpp 和SortingTestSetIterator.cpp 的cpp 文件。
现在,我想创建包含来自 cpp 文件和静态库的符号的动态库。我可以在 Linux(Ubuntu 12.04 x64,g++ 版本 4.8.1)中这样做:
g++ -fPIC SortingAbsAlgorithm.cpp SortingTestCase.cpp SortingTestSetIterator.cpp -shared -o libProject.so -Wl,--whole-archive -lAlgatorc -Wl,--no-whole-archive
但我不能在 OS X 上执行此操作。clang 没有 -Wl,--whole-archive 选项。
我有以下 clang 版本:
$ clang --version
Apple LLVM version 7.0.0 (clang-700.0.53.3)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
有什么建议吗?
【问题讨论】:
标签: macos shared-libraries clang static-libraries