It took me a bit to figure out the difference between my test code (which requires the patch) and yours (which can't have it). It was subtle.

Try this patch (attached).

dw

On 9/16/2016 1:39 AM, Mateusz wrote:
Hello,
Since this commit I'm not able to compile Qt5 with GCC 6.1.0 and 6.2.0
errors:

In file included from
D:/msys64/mingw64/x86_64-w64-mingw32/include/mfidl.h:73:0,
                  from example.cc:1:
D:/msys64/mingw64/x86_64-w64-mingw32/include/mftransform.h:709:47: error:
'selectany' attribute applies only to initialized variables with external
linkage
  EXTERN_C const DECLSPEC_SELECTANY PROPERTYKEY MFPKEY_CLSID =
{{0xc57a84c0,0x1a80,0x40a3,{0x97,0xb5,0x92,0x72,0xa4,0x3,0xc8,0xae}}, 0x01};
                                                ^~~~~~~~~~~~


diff --git a/mingw-w64-headers/include/mftransform.h b/mingw-w64-headers/include/mftransform.h
index 4738b4a..954c861 100644
--- a/mingw-w64-headers/include/mftransform.h
+++ b/mingw-w64-headers/include/mftransform.h
@@ -701,7 +701,7 @@ void __RPC_STUB IMFTransform_ProcessMessage_Stub(
 
 #endif  /* __IMFTransform_INTERFACE_DEFINED__ */
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__cplusplus)
 #undef EXTERN_C
 #define EXTERN_C
 #endif
diff --git a/mingw-w64-headers/include/mftransform.idl b/mingw-w64-headers/include/mftransform.idl
index 11d5988..bea0182 100644
--- a/mingw-w64-headers/include/mftransform.idl
+++ b/mingw-w64-headers/include/mftransform.idl
@@ -145,7 +145,7 @@ interface IMFTransform : IUnknown
 
 /* In gcc, declaring something 'extern' and then initializing it
    generates a warning.  */
-cpp_quote("#ifdef __GNUC__")
+cpp_quote("#if defined(__GNUC__) && !defined(__cplusplus)")
 cpp_quote("#undef EXTERN_C")
 cpp_quote("#define EXTERN_C")
 cpp_quote("#endif")
------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to