I wanted to try MinGW with juce for some faster then VS builds, and almost got it, but some errors appeared
First my gcc version is the latest i could find:
C:\Users\atom>gcc -v C:\Users\atom>g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.7.0/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.7.0/configure --enable-languages=c,c++,ada,fortran,ob c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libg mp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1 with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.7.0 (GCC)
First there are the includes, DIRECTWRITE and WASAPI don’t work out of the box in MINGW had to disable those.
This is an error that turns into a warning if “-fpermissive” is passed to GCC
In file included from C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/juce_core.cpp:177:0: C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/native/juce_win32_ComSmartPtr.h: In member function 'HRESULT juce::ComBaseClassHelper<ComClass>::QueryInterface(const IID&, void**)': C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/native/juce_win32_ComSmartPtr.h:139:54: warning: there are no arguments to 'AddRef' that depend on a template parameter, so a declaration of 'AddRef' must be available [-fpermissive]
This one can be fixed by adding #include malloc.h somewhere in the code (alloca needs it)
In file included from C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_graphics/juce_graphics.cpp:85:0: C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_graphics/geometry/juce_EdgeTable.cpp: In member function 'void juce::EdgeTable::intersectWithEdgeTableLine(int, const int*)': C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_graphics/geometry/juce_EdgeTable.cpp:442:57: error: 'alloca' was not declared in this scope C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_graphics/geometry/juce_EdgeTable.cpp: In member function 'void juce::EdgeTable::clipLineToMask(int, int, const uint8*, int, int)': C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_graphics/geometry/juce_EdgeTable.cpp:693:82: error: 'alloca' was not declared in this scope
This one is related to windows versions (as described here http://stackoverflow.com/questions/5247862/error-with-regopenkeyex), I don’t know what windows versions JUCE supports i think there has to be some minimal XP build (SP2?). Setting the -D_WIN32_WINNT didn’t help much, had to replace the function getValueWow64() with something that does not use that KEY_WOW64_64KEY constant, since i don’t use the registry stuff myself it’s not a big problem for me.
In file included from C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/juce_core.cpp:180:0: C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/native/juce_win32_Registry.cpp: In static member function 'static juce::String juce::WindowsRegistry::getValueWow64(const juce::String&, const juce::String&)': C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/native/juce_win32_Registry.cpp:134:70: error: 'KEY_WOW64_64KEY' was not declared in this scope
This one can be fixed by replacing GetUserDefaultUILanguage() with GetUserDefaultLangID() (taken from the how to build GIMP on windows tutorial http://meudepositodeideias.wordpress.com/2011/12/19/how-to-build-gimp-2-7-5-using-mingw-in-windows-32-bits/)
In file included from C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/juce_core.cpp:181:0: C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/native/juce_win32_SystemStats.cpp: In static member function 'static juce::String juce::SystemStats::getDisplayLanguage()': C:/devel/ctrlrv4/nightly/Builds/Standalone/JuceLibraryCode/modules/juce_core/native/juce_win32_SystemStats.cpp:406:68: error: 'GetUserDefaultUILanguage' was not declared in this scope