[SOLVED] Error with VS2015 regarding snprintf


#1

Hello,

I'm trying out the Visual Studio 2015 RC and while trying to build my plugin, I got this error: 


Error    C1189    #error:  Macro definition of snprintf conflicts with Standard Library function declaration (compiling source file ..\..\JuceLibraryCode\modules\juce_audio_plugin_client\VST3\juce_VST3_Wrapper.cpp)    Synthesizer    c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\stdio.h    1927
 

Is there an easy solution to fixing this in the JUCE files where it only has that behavior for VS2015? If so, it should probably be fixed in JUCE. I did find this post on StackOverflow regarding the same error, as well as the link for that error number on Microsoft's site.

http://stackoverflow.com/questions/27754492/vs-2015-compiling-cocos2d-x-3-3-error-fatal-error-c1189-error-macro-definiti

https://msdn.Microsoft.com/en-us/library/y0tzt8e0(v=vs.140).aspx

 

There's also a huge list of warnings (349 for this project) and most of them are from JUCE library code.

 

Btw, I'm using version 3.1.1 and it has the same error with the JuceDemoPlugin


#2

Is it the same as this? http://www.juce.com/forum/topic/vs2015-community-rc-project-problem


#3

Haha. Yes, I believe so. Sorry about that. I'm not sure how I didn't find that post. I'll delete this one after I try the fix in that post.

Edit: Oh dang, it doesn't seem like you can delete posts. If you can, you can delete this post. I got it working thanks to that other post. I couldn't find the file that had that #define. 


#4

Just in case anyone has this problem and finds this post, here's a way to fix it, which is also mentioned in the link Jules posted.

It's caused by this #define in VST3_SDK\pluginterfaces\base\fstrdefs.h on line 102:

#define snprintf _snprintf



To get it working you can replace it with this:


#if _MSC_VER < 1900 
#define snprintf _snprintf
#endif