The toolchain I downloaded and am using is from here:
It builds for a 32-bit target and this toolchain is built to use DW2 dwarf unwinding instead of setjump longjump for exception handling.
I downloaded blender's svn with TortoiseSVN and proceed to build it with cmake. I had to make a couple of changes to the blender source for it to be able to compile without errors.
The first change: add_definitions(-D__MINGW64__)
that was added keep extern libmv from redefining sincos in its numerical.h file. This function is already present in mingw's math.h
The second change in GHOST_SystemWin32.cpp is because mingw's definition does agree now, at least the headers supplied by ruben's toolchain does. So I had to comment out that workaround so compile can proceed.
The final change in BLI_winstuff.h is because mingw-w64 uses a different macro guard than mingw. For this I just added both of them in there. I believe this issue came up in the past before but it wasn't clear how best to fix it -- the suggested solution at the time was to just pass -D_SSIZE_T_DEFINED when compiling that file in question.
The external library dependencies used during the linking step is whatever is provided in /lib/mingw32.
I'm able to build blender but the compiled executable would just crash during startup. Blender gets as far as creating the window but none of the GUI elements are drawn before the crash happens. So no menus, no viewport, just a blank gray background window with borders.
I have a backtrace of the crash in gdb if anyone's interested. Any idea why this is happening?
I'm having the same problem. I build the blender trunk version and when I run it crashes.
I'm trying to build using Visual Studio 2008 but I found some problems compiling the code.
I'll give feedback if I find anything.
Anyday, anytime, anywhere
Without a stack trace or compiler errors, it is difficult to say anything beyond the standard "graphics driver problems".
Someone was having issues with OpenColorIO crashing on Windows the other day.
Well I found out the root cause for the crash: Mingw64-32bit compiler comes with it's own pthread named
. The default cmake build for mingw32 (the original compiler from mingw.org NOT mingw-w64.sourceforge.net) does not include the pthread library so blender's ext comes with it (it's under /lib/mingw32/pthreads of the repo).
Linking pthread that's meant for mingw.org's compiler with mingw64-32 bit from mingw-w64.sourceforge.net does not work since they're not binary compatible.
To fix it I modified the cmake to not link to /lib/mingw32/pthreads but instead to just link with libwinpthread-1.dll. That fixes the crashing issue and the compiled blender seems to work now.