Hi Jules,
It seems that when a VS2012 project uses the MIDL compiler, because there is an .idl file ( you know, to define COM classes and interfaces), the prototype of WinMain that the compiler expects is:
int __stdcall WinMain (HINSTANCE, HINSTANCE, const LPSTR, int)
instead of:
int __stdcall WinMain (void*, void*, const char*, int)
I got this conclusion because the VS2012 c++ compiler complains showing C2733 (second C linkage of overloaded function ‘function’ not allowed) and C2731 (The function WinMain cannot be overloaded.) errors.
I was diving into juce_Initialisation.h and I discovered that in the #IF DEFINE nest:
#if JUCE_WINDOWS
#if defined (WINAPI) || defined (_WINDOWS_)
#define JUCE_MAIN_FUNCTION int __stdcall WinMain (HINSTANCE, HINSTANCE, const LPSTR, int)
#elif defined (_UNICODE)
#define JUCE_MAIN_FUNCTION int __stdcall WinMain (void*, void*, const wchar_t*, int)
#else
#define JUCE_MAIN_FUNCTION int __stdcall WinMain (void*, void*, const char*, int)
#endif
#define JUCE_MAIN_FUNCTION_ARGS
#else
#define JUCE_MAIN_FUNCTION int main (int argc, char* argv[])
#define JUCE_MAIN_FUNCTION_ARGS argc, (const char**) argv
#endif
reachs that WINAPI or WINDOWS is not defined. So JUCE_MAIN_FUNCTION is defined as int __stdcall WinMain (void*, void*, const char*, int) what the compiler not expect.
I’ve solved it temporally bypassing all the #if segment code and hardcoding the WinMain that the compiler expects: int __stdcall WinMain (HINSTANCE, HINSTANCE, const LPSTR, int)
But I think you can fix it to be compatible with the #IF DEFINE code
Gabriel