title: Disable linker warning in Visual Studio 2015 (LNK4221,LNK4006)
body: <p>How to suppress (hide) LNK4221,4006 warning in Visual Studio 2015?      </p>
  
  <blockquote>
    <p>D:\solutionFolder\projectFolder\OgreHlmsPbs_d.lib(OgreHlmsPbs_d.dll)  1   __NULL_IMPORT_DESCRIPTOR
    already defined in OgreOverlay_d.lib(OgreOverlay_d.dll); second
    definition ignored    LNK4006</p>
    
    <p>D:\solutionFolder\projectFolder\OgreHlmsPbs_d.lib(OgreHlmsPbs_d.dll)  1   This
    object file does not define any previously undefined public symbols,
    so it will not be used by any link operation that consumes this
    library   LNK4221</p>
  </blockquote>
  
  <p>The program run fine.</p>
  
  <p>I use librarian (same as a SO question : <a href="https://stackoverflow.com/questions/24103488/lnk4006-lnk4221-warnings-when-using-static-library-that-includes-another-static/30537907">LNK4006, LNK4221 warnings when using static library that includes another static library</a>).</p>
  
  <p><strong>I have tried :-</strong></p>
  
  <ul>
  <li>Linker > all options  > additional option = <code>/ignore:4221,4006</code></li>
  <li>Linker > Command Line > additional option = <code>/ignore:4221,4006</code></li>
  <li>Librarian > all options  > additional option = <code>/ignore:4221,4006</code></li>
  <li>Librarian > Command Line  > additional option = <code>/ignore:4221,4006</code></li>
  </ul>
  
  <p>I have set it to both user-project and the static library.     </p>
  
  <p>I have also tried <code>/ignore:4221</code> alone for the above 4 combination, it can't suppress LINK4221.<br>
   Capital <code>/IGNORE:4221</code> doesn't work either.</p>
  
  <p>All of the above don't solve. Are there any other combination?</p>
  
  <p>I don't want to modify my code e.g.    </p>
  
  <pre><code>__declspec( dllexport ) void getRidOfLNK4221(){}    
  </code></pre>
  
  <p><strong>I have read :-</strong> </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/20854324/how-to-eliminate-warning-lnk4221">How to eliminate Warning LNK4221?</a>  and <a href="https://stackoverflow.com/questions/661606/visual-c-how-to-disable-specific-linker-warnings">Visual C++: How to disable specific linker warnings?</a>  (provide some of the above non-working solutions)</li>
  <li><a href="http://www.geoffchappell.com/studies/msvc/link/link/options/ignore.htm" rel="noreferrer">http://www.geoffchappell.com/studies/msvc/link/link/options/ignore.htm</a> implies that both 4221 and 4006 can be disable.</li>
  </ul>
  
  <p>I guess this version of Visual Studio (2015) may have different way to fix this issue.</p>
  
  <h2>Further investigation</h2>
  
  <p>After posting the question, I found  :-  </p>
  
  <ul>
  <li><a href="https://msdn.microsoft.com/en-us/library/b7whw3f3.aspx" rel="noreferrer">https://msdn.microsoft.com/en-us/library/b7whw3f3.aspx</a> :  The error is about not found <code>.pdb</code>.      </li>
  <li><a href="https://stackoverflow.com/questions/25843883/how-to-remove-warning-lnk4099-pdb-lib-pdb-was-not-found">How to remove warning LNK4099: PDB &#39;lib.pdb&#39; was not found</a>      </li>
  </ul>
  
  <p>I started to think that using <strong>librarian</strong> is probably not a good idea in the first place.     </p>
  
  <p>However, even I don't set <strong>librarian</strong>, I still get this warning for my own empty <code>MyClass.cpp</code>.<br>
  Therefore, this problem is probably not related to <strong>librarian</strong>.</p>
  
  <blockquote>
    <p>D:\solutionFolder\projectFolder\MyClass.obj   1   This object file does
    not define any previously undefined public symbols, so it will not be
    used by any link operation that consumes this library LNK4221</p>
  </blockquote>