【问题标题】:IOS target link the cocoa stack library which has the library write in the C++11 standard errorIOS目标链接可可堆栈库,该库在C++11标准错误中写入
【发布时间】:2012-08-09 14:14:21
【问题描述】:

我正在做一个项目,它是一个使用别人编写的 C++ 库的可可静态库。这个 C++ 库使用了 C++11 和 libc++(支持 C++ 11 的 LLVM C++ 标准库)。

我成功构建了可可库,但是当我在应用程序中链接这个库时(只需在“Link Binary with Libraries”中添加链接)。

发生错误,这是错误日志:

"non-virtual thunk to std::__1::basic_iostream<char, std::__1::char_traits<char> >::~basic_iostream()", referenced from:


  "non-virtual thunk to std::__1::basic_iostream<char, std::__1::char_traits<char> >::~basic_iostream()", referenced from:


  "non-virtual thunk to std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()", referenced from:


  "non-virtual thunk to std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()", referenced from:


  "non-virtual thunk to std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::~basic_istream()", referenced from:


  "non-virtual thunk to std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::~basic_istream()", referenced from:


  "non-virtual thunk to std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream()", referenced from:


  "non-virtual thunk to std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream()", referenced from:


  "non-virtual thunk to std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::~basic_ostream()", referenced from:


  "non-virtual thunk to std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::~basic_ostream()", referenced from:


  "non-virtual thunk to std::__1::basic_iostream<char, std::__1::char_traits<char> >::~basic_iostream()", referenced from:


  "non-virtual thunk to std::__1::basic_iostream<char, std::__1::char_traits<char> >::~basic_iostream()", referenced from:


  "operator delete[](void*)", referenced from:


  "operator delete(void*)", referenced from:


  "operator new[](unsigned long)", referenced from:


  "operator new(unsigned long)", referenced from:


  "___cxa_begin_catch", referenced from:


  "___cxa_end_catch", referenced from:


  "___cxa_pure_virtual", referenced from:


  "___cxa_rethrow", referenced from:


  "___gxx_personality_v0", referenced from:


  "_crc32", referenced from:


  "_deflate", referenced from:


  "_deflateEnd", referenced from:


  "_deflateInit2_", referenced from:


  "_get_crc_table", referenced from:


  "_inflate", referenced from:


  "_inflateEnd", referenced from:


  "_inflateInit2_", referenced from:

这看起来像是关于链接 C++11 库的问题,但我对此一无所知。 也许在APP中链接可可静态库使用libstdc++标准,没有C++11标准, 所以冲突就发生在这里。 但我不确认这一点。

你能帮我吗?

谢谢

【问题讨论】:

    标签: c++ ios c++11 static-libraries xcodebuild


    【解决方案1】:

    因为我错过了链接 libc++.dylib 库。

    因此产生了这些错误。

    注意:Clang 支持 C++11。

    【讨论】:

      猜你喜欢
      • 2015-12-09
      • 2021-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-16
      • 1970-01-01
      • 2013-07-28
      相关资源
      最近更新 更多