title: Xamarin.iOS native linking error MTOUCH MT5210 undefined symbol std::string
body: <p>My Xamarion.iOS binding project has the links to all the required native video SDK libraries and native OS frameworks.  I have set the required frameworks using Frameworks attribute. Other settings include SmartLink=true, ForceLoad=true, IsCxx=true, LinkerFlags=&quot;-lc++&quot;. It can be built into a C# DLL. In iOS project, the DLL is referenced and used.  However there are native linking errors.</p>
  <pre><code>MTOUCH: Error MT5210: Native linking failed, undefined symbol: std::string::_Rep::_M_destroy(std::allocator&lt;char&gt; const&amp;). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. 
  </code></pre>
  <p>The details in build log:</p>
  <pre><code>&gt; Undefined symbols for architecture arm64:
  &gt;       &quot;std::string::_Rep::_M_destroy(std::allocator&lt;char&gt; const&amp;)&quot;, referenced from:
  &gt;           HPR_UTF82A(char const*) in libHCCore.a(HPR_Utils.o)
  &gt;           HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
  &gt;       &quot;std::string::_Rep::_S_empty_rep_storage&quot;, referenced from:
  &gt;           HPR_UTF82A(char const*) in libHCCore.a(HPR_Utils.o)
  &gt;           HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
  &gt;       &quot;std::string::assign(char const*, unsigned long)&quot;, referenced from:
  &gt;           HPR_UTF82A(char const*) in libHCCore.a(HPR_Utils.o)
  &gt;           HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
  &gt;       &quot;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string(char const*, std::allocator&lt;char&gt;
  &gt; const&amp;)&quot;, referenced from:
  &gt;           HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
  &gt;       &quot;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string(std::string const&amp;)&quot;, referenced
  &gt; from:
  &gt;           HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
  &gt;     ld: symbol(s) not found for architecture arm64
  &gt;     clang : error : linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  <p>The wrap errors:</p>
  <pre><code>MTOUCH: Warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker (MT5215)
  
  Error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC (MT5201)
  
  MTOUCH: Error MT5202: Native linking failed. Please review the build log. (MT5202)
  
  clang: Error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  <p>Please shed light. Thanks.</p>
  <p>No such native linking error in Xcode. The build settings:</p>
  <p><a href="https://i.stack.imgur.com/JzTPK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JzTPK.jpg" alt="enter image description here" /></a></p>