gpt4 book ai didi

c++ - IOS 目标链接 Cocoa 堆栈库,该库具有 C++11 标准错误中写入的库

转载 作者:行者123 更新时间:2023-11-30 00:55:39 26 4
gpt4 key购买 nike

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

我成功地构建了 cocoa 库,但是当我在应用程序中链接这个库时(只需在“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中链接cocoa静态库使用了libstdc++标准,没有C++11标准,所以冲突就在这里发生了。但我不证实这一点。

你能帮帮我吗?

谢谢

最佳答案

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

因此产生这些错误。

注意:Clang 支持 C++11。

关于c++ - IOS 目标链接 Cocoa 堆栈库,该库具有 C++11 标准错误中写入的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11885413/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com