title: C++: Unresolved external symbol _sprintf and _sscanf in Visual Studio 2015
body: <p>For a research project, I'm writing a C++ add-on to a scientific computing language. Unfortunately the library that allows users to do this is not kept very well up-to-date.</p>
  
  <p>I started the project in XCode, where it built fine. Later I had to move to a PC, so I migrated the code to Visual Studio 2015. Since doing this, I haven't been able to build due to the following errors:</p>
  
  <pre><code>LNK2001 : unresolved external symbol _sprintf
  LNK2019 : unresolved external symbol _sscanf referenced in function _GetDDouble
  LNK2019 : unresolved external symbol _sprintf referenced in function _CheckRunningInMainThread
  </code></pre>
  
  <p>An attempted fix was to add the header <code>#define _CRT_SECURE_NO_WARNINGS</code>. However, this a) fixed no errors and b) added the warning <code>C4005 : '_CRT_SECURE_NO_WARNINGS': macro redefinition</code>. I assume the library already defined this macro, anticipating this problem. Regardless, it didn't solve the problem.</p>
  
  <p>How should I proceed?</p>