Latest MINGW builds


#1

i got a juce app to build but:

#include <wspiapi.h>

is needed in the juce_Socket.cpp (you need to get that file off the internet, it’s not in the MINGW distro)

also

#include <imm.h>

is needed in juce_win32_NativeIncludes.h

list of libraries needed for linking:

libshell32.a
libole32.a
libvfw32.a
libwinmm.a
libwininet.a
libws2_32.a
libdsound.a
libwsock32.a
libwldap32.a
libkernel32
libopengl32.a
libglu32.a
libuuid.a
librpcrt4.a
libgdi32.a
libcomdlg32.a
libversion.a
libdsound.a
libimm32
libshlwapi

I do get a SIGSEGV everytime i try to open a new window with images in it, VS/Linux/OSX do not report any problems when doing the same operations it only appears when using MINGW

0  0x00833d30  zlibNamespace::inflate_table  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/io/streams/zlib/inftrees.c  107
1  0x0085fdfe  z_inflate  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/io/streams/zlib/inflate.c  851
2  0x008eb1bd  pnglibNamespace::png_read_row  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/graphics/imaging/image_file_formats/pnglib/pngread.c  720
3  0x008ec117  png_read_image  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/graphics/imaging/image_file_formats/pnglib/pngread.c  902
4  0x008ec117  juce::PNGImageFormat::decodeImage  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp  228
5  0x00959877  juce::ImageFileFormat::loadFrom  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/graphics/imaging/juce_ImageFileFormat.cpp  70
6  0x00959877  juce::ImageFileFormat::loadFrom  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/graphics/imaging/juce_ImageFileFormat.cpp  93
7  0x009d3d65  juce::ImageCache::getFromMemory  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/graphics/imaging/juce_ImageCache.cpp  166
8  0x00600799  CtrlrAbout  C:/devel/ctrlr/Source/UIComponents/CtrlrAbout.cpp  113
9  0x0062f522  CtrlrMenu::buttonClicked  C:/devel/ctrlr/Source/UIComponents/CtrlrMenu.cpp  479
10  0x00a6aa0d  callChecked<juce::Component::BailOutChecker, juce::Button*>  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/components/../../events/juce_ListenerList.h  181
11  0x00a6aa0d  juce::Button::sendClickMessage  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/components/buttons/juce_Button.cpp  384
12  0x00a73c4f  juce::Component::internalMouseUp  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/components/juce_Component.cpp  2481
13  0x00c184e7  juce::MouseInputSourceInternal::sendMouseUp  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/components/mouse/juce_MouseInputSource.cpp  134
14  0x00c184e7  juce::MouseInputSourceInternal::setButtons  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/components/mouse/juce_MouseInputSource.cpp  166
15  0x00a8a71b  juce::MouseInputSourceInternal::handleEvent  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/components/mouse/juce_MouseInputSource.cpp  279
16  0x00a8a71b  juce::MouseInputSource::handleEvent  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/gui/components/mouse/juce_MouseInputSource.cpp  528
17  0x00ba4349  juce::Win32ComponentPeer::doMouseEvent  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/native/windows/juce_win32_Windowing.cpp  1396
18  0x00ba4349  juce::Win32ComponentPeer::doMouseUp  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/native/windows/juce_win32_Windowing.cpp  1495
19  0x00ba06a3  juce::Win32ComponentPeer::peerWindowProc  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/native/windows/juce_win32_Windowing.cpp  2051
20  0x00b9e6d9  juce::Win32ComponentPeer::windowProc  C:/devel/ctrlr/JuceLibraryCode/../../juce/amalgamation/../src/native/windows/juce_win32_Windowing.cpp  1969
21  0x76fb86ef  USER32!IsWindowVisible    
22  0x000f059c  ??    
23  0x00000202  ??  c:/mingw-4.4.1/bin/../lib/gcc/mingw32/4.4.1/include/c++/bits/stl_uninitialized.h  73
24  0x00000000  ??    

#2

Nice!.. and thanks for the info.
Using that, I have created an Eclipse workspace that compile in Windows (MinGW) and Debian 6.
Now we have a tool to use with JUCE 1.54.27 under Eclipse and Windows/Linux.
I made four build configurations:

  • Debug (Linux)
  • Release (Linux)
  • Debug (Windows)
  • Release (Windows)

I tested it with JUCE_HELLO_WORLD and JUCE_DEMO projects without any problem.
The workspace is here:
http://www.4shared.com/file/EevDkTtf/JUCE_ECLIPSE_LINUX_WINDOWS.html

You can download juce1.54.17 with MinGW changes from here:
http://www.4shared.com/file/_dR0DJjQ/JUCE1_54_27_MinGW.html

Regards


#3

What changes did you need to make for mingw? If it’s simple stuff I’d be happy to roll it into the main build.


#4

Hi Jules, these are my minor corrections to compile with MinGW:

  1. Correction: MinGW doesn’t support the function __uuidof, so you should modify the file
    "\juce\src\native\windows\juce_win32_ComSmartPtr.h" with this:

    template
    HRESULT QueryInterface (ComSmartPtr& destObject) const
    {
    #ifndef MINGW32
    return this->QueryInterface (__uuidof (OtherComClass), destObject);
    #else
    return E_NOTIMPL;
    #endif
    }

  2. Correction: MinGW doesn’t find functions “getaddrinfo” and “freeaddrinfo”. Be sure that you have installed
    the file “wspiapi.h” in your “MinGW/include” directory. If not, you should get a copy from
    http://www.koders.com/c/fid275FEAF57FA3E640A9425FB3A46D988E1F72B61D.aspx
    Then append a #include <wspiapi.h> in “.\juce\src\io\network\juce_Socket.cpp”

  3. Correction: MinGW doesn’t find “HIMC” class and others when compiling “\juce\src\native\windows\juce_win32_Windowing.cpp”.
    You should append “#include <Imm.h>” at beginning, and then append “libimm32.a” to linker library configuration.

That’s all


#5

Ok, thanks…

But beware that if you stub-out that QueryInterface method, a whole heap of COM-based functionality is going to stop working! Isn’t there are way to simulate __uuidof in mingw?


#6

Oh… and you must be hacking on an old version of the library - in the latest modules branch I’ve already done some of this.


#7

Searching the web, I found that by the moment we don’t have a __uuidof function for MinGW.
Some people get GUIDs from VS debugger and then copy them to the code.

I guess it’s not a smart way to do it but it should works.

See the topic bellow:
http://osdir.com/ml/gnu.mingw.devel/2007-03/msg00058.html

More ideas:

Mingw is not perfect :frowning:

Regards