title: Could I ignore C4251 warning in this case?
body: <p>I understand why I have C4251 warning when I compile my codes as explained in <a href="http://msdn.microsoft.com/en-us/library/esew7y1w.aspx" rel="nofollow">here</a>. My question is if the accessible export class members are from STL, could we ignore C4251 warning? I give a simple example to illustrate my question:</p>
  
  <p>dll.h</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class __declspec(dllexport) HelloWorld
  {
  public:
    string name;
    HelloWorld();
    HelloWorld(const string &amp;str);
  
  };
  </code></pre>
  
  <p>dll.cpp</p>
  
  <pre><code>#include "dll.h"
  
  HelloWorld::HelloWorld()
  {
    name ="";
  }
  HelloWorld::HelloWorld(const string &amp;str)
  { 
   name = str;
  }
  </code></pre>
  
  <p>The warning information I have obtained is as followings:</p>
  
  <pre><code>Warning 1   warning C4251: 'HelloWorld::name' : class 'std::basic_string&lt;_Elem,_Traits,_Ax&gt;' needs to have dll-interface to be used by clients of class 'HelloWorld'    *\dll.h 9
  </code></pre>
  
  <p>My question is: can I ignore this warning? The way how I use this library is also very simple:</p>
  
  <pre><code>#include "dll.h"
  #include &lt;iostream&gt;
  using namespace std;
  
  int main(void)
  {
    HelloWorld myworld;
    myworld.name = "Tom's world";
    cout&lt;&lt;myworld.name&lt;&lt;endl;
    return 0;
  }
  </code></pre>