gpt4 book ai didi

c++ - 如何将 C++ 标准库链接到 Monotouch 应用程序

转载 作者:太空狗 更新时间:2023-10-29 20:26:49 27 4
gpt4 key购买 nike

我正在将一个企业库绑定(bind)到我的 Monotouch 应用程序。这是一个艰巨的过程,因为 Objective Sharpie 未能创建 API,我不得不发挥创造力。
但是现在,在编译终于成功之后,我面临着一个链接问题

Undefined symbols for architecture armv7:
"std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_ in libWeANDSFLibrary.a(WfStringBody.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::resize(unsigned long, char)", referenced from:
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::overflow(int)in libWeANDSFLibrary.a(WfStringBody.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)in libWeANDSFLibrary.a(WfStringBody.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)", referenced from:
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::overflow(int)in libWeANDSFLibrary.a(WfStringBody.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
wflang::CWfStringBody::Float64ToArray(double, unsigned short*)in libWeANDSFLibrary.a(WfStringBody.o)
std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream()in libWeANDSFLibrary.a(WfStringBody.o)
std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream()in libWeANDSFLibrary.a(WfStringBody.o)
virtual thunk to std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream()in libWeANDSFLibrary.a(WfStringBody.o)
virtual thunk to std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream()in libWeANDSFLibrary.a(WfStringBody.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_stringbuf()in libWeANDSFLibrary.a(WfStringBody.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_stringbuf()in libWeANDSFLibrary.a(WfStringBody.o)
...

等等。我尝试遵循 Wrapping a C++ library in Objective-C is not hiding the C++ symbols 中的建议但它没有用。有什么想法吗?

最佳答案

您好,您似乎正在使用非 C++ 编译器进行编译,您可能想尝试在 iOS 项目选项LinkWith attribute 中设置它你应该设置 IsCxx = true在您的 iOS 绑定(bind)项目

iOS 项目构建选项 的可用选项是

  • --编译器:gcc
  • --编译器:g++
  • --编译器:clang
  • --编译器:clang++

你应该试试 --compiler:g++--compiler:clang++

image

希望对你有帮助

亚历克斯

关于c++ - 如何将 C++ 标准库链接到 Monotouch 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18510968/

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