Mac Lion 无法使用"ar"创建库,'no symbols'
Mac Lion cannot create library using 'ar', 'no symbols'
我有c++源代码在IO.h和IO.cpp,并希望使一个静态库libvcf。一个。然后使用以下命令:
g++ -c IO.cpp
没有问题。
,
ar -r libvcf.a IO.o
/usr/bin/ranlib: file: libvcf.a(IO.o) has no symbols
我现在使用的是Mac OSX Lion,下面是g++版本:
g++ -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
看起来我可以在Linux上使用相同的命令,但不能在Mac上使用。我也谷歌了一下,没有运气。有什么建议吗?谢谢。
我认为完整的命令应该是:
ar rcs libvcf.a IO.o
c
的意思是"创建存档"。
相关文章:
- "error: no matching function for call to"构造函数错误
- 调用专用模板时出错"no matching function for call to [...]"
- c++20[[no.unique_address]]中的新功能是什么
- 以线程安全的方式调用"QQuickPaintedItem::updateImage(const QImage&image)"(no QThread)
- "no matching function for call to 'Vector::Vector'"错误
- Android NDK clang 编译器错误在 Windows 上显示'No such file or directory'
- 处理"no operator found"
- 我在 ifstream input_file(文件名)行中收到错误"no matching function to call";
- 如何解决"no Qt platform plugin could be initialized"问题?
- "Unable to start debugging. No process is associated with this object." - 在Visual Studio Code中使用GDB
- 为什么当我在 std::string 中打开文件名的 fstream 时出现"no matching function"错误?
- 已解决 - C++ 的崇高文本中的"fatal error: opencv: no such file or directory"
- do while 循环中的 if 语句以 yes 或 no 结尾
- 从 TVector2 类派生复杂类:"No matching function for call to Complex::Complex()"
- 错误消息:使用"string* +="后"no match for 'operator+='"
- 与卡特琳娜一起卷曲C++失败并得到"Undefined symbols for architecture x86_64"
- Eulers 项目问题 no 345 听不懂几行代码
- "No-Const Pointer to Const "调用功能
- "The breakpoint will not currently be hit. No symbols have been loaded for this document." Visual S
- Mac Lion 无法使用"ar"创建库,'no symbols'