Visual Studio 2015 - error C2375: 'snprintf': redefinition; different linkage
<p>I'm getting the above error when compiling a C++ project in Visual Studio 2015, but there is no problem when compiling in 2013. The error is from a header file in the OpenOfice SDK - snprintf.h. This is the line of code which causes the error:</p>

<pre><code>__declspec(dllimport) int __cdecl snprintf(char *buffer, size_t count, const char *format, ...);
</code></pre>

<p>I believe this is because VC 2015 already defines snprintf. <a href="https://github.com/OpenDUNE/OpenDUNE/issues/254" rel="nofollow">See this page for more info</a></p>

<p>The solution on that page which is effectively the same as commenting out this line does not work for me, because it causes a lot of other errors in the project. Also as I said this compiles with no problem in Visual Studio 2013, so I would like to know if anyone else has come across a similar problem and has a way to fix this error.</p>

<p>Thanks.</p>