Thanks for the suggestions everyone! I've found the _mingw.h defined macros to be incompatible with JUCE, as far as I can tell. Using the MinGW64 defines for (__uuidof, KSDATAFORMAT_SUBTYPE_PCM, KSDATAFORMAT_SUBTYPE_IEEE_FLOAT), creates lots of compile and linker errors.
My basic approach is to just undefine them, and use the JUCE included defines... and that seems to work fine. For example:
#if JUCE_MINGW && defined(__uuidof)
#undef __uuidof
#endif
I've attached a patch which fixes all the compiler and linker errors for MinGW (with regards to WASAPI, which is what I'm testing right now). Please let me know what you think. Okay, I'm unable to attach a TXT patch file to this post... so I'm including it here (sorry).
Index: JuceLibraryCode/modules/juce_core/native/juce_BasicNativeHeaders.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
— JuceLibraryCode/modules/juce_core/native/juce_BasicNativeHeaders.h (date 1441235347000)
+++ JuceLibraryCode/modules/juce_core/native/juce_BasicNativeHeaders.h (revision )
@@ -104,6 +104,9 @@
#include <ctime>
#include <wininet.h>
#include <nb30.h>
-
#if JUCE_MINGW
- #include <winsock2.h>
-
#endif
#include <iphlpapi.h>
#include <mapi.h>
#include <float.h>
Index: JuceLibraryCode/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
===================================================================
— JuceLibraryCode/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp (date 1441235347000)
+++ JuceLibraryCode/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp (revision )
@@ -112,6 +112,11 @@
#define JUCE_COMCLASS(name, guid) struct __declspec (uuid (guid)) name
#endif
+#if JUCE_MINGW && defined(KSDATAFORMAT_SUBTYPE_PCM)
- #undef KSDATAFORMAT_SUBTYPE_PCM
- #undef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
+#endif
-
#ifndef KSDATAFORMAT_SUBTYPE_PCM
#define KSDATAFORMAT_SUBTYPE_PCM uuidFromString (“00000001-0000-0010-8000-00aa00389b71”)
#define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT uuidFromString (“00000003-0000-0010-8000-00aa00389b71”)
Index: JuceLibraryCode/modules/juce_core/native/juce_win32_ComSmartPtr.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
— JuceLibraryCode/modules/juce_core/native/juce_win32_ComSmartPtr.h (date 1441235347000)
+++ JuceLibraryCode/modules/juce_core/native/juce_win32_ComSmartPtr.h (revision )
@@ -29,6 +29,10 @@
#ifndef JUCE_WIN32_COMSMARTPTR_H_INCLUDED
#define JUCE_WIN32_COMSMARTPTR_H_INCLUDED
+#if JUCE_MINGW && defined(__uuidof)
#if ! (defined (_MSC_VER) || defined (__uuidof))
template<typename Type> struct UUIDGetter { static CLSID get() { jassertfalse; return CLSID(); } };
#define __uuidof(x) UUIDGetter<x>::get()
Index: JuceLibraryCode/modules/juce_core/maths/juce_MathsFunctions.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
— JuceLibraryCode/modules/juce_core/maths/juce_MathsFunctions.h (date 1441235347000)
+++ JuceLibraryCode/modules/juce_core/maths/juce_MathsFunctions.h (revision )
@@ -376,7 +376,7 @@
template <>
inline bool juce_isfinite (float value) noexcept
{
- #if JUCE_WINDOWS && !JUCE_MINGW
return _finite (value) != 0;
#else
return std::isfinite (value);
@@ -386,7 +386,7 @@
template <>
inline bool juce_isfinite (double value) noexcept
{
- #if JUCE_WINDOWS && !JUCE_MINGW
return _finite (value) != 0;
#else
return std::isfinite (value);
It would be great if this patch (or something similar) could be applied to the source code. Next stop, JUCE_ASIO, which also has some MinGW64 compile errors (I'll create a new post for that). Thanks again!
Thanks!
-Jonathan Thomas