Previous Thread  Next Thread

chat icon Mingw32 4.6.3 builds but blender.exe crashes

greatwolf

Posted: Mon Dec 24, 2012 5:01 pm
Joined: 04 Dec 2012
Posts: 3
The toolchain I downloaded and am using is from here:
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-dw2-4.6-release/i686-w64-mingw32-gcc-dw2-4.6.3-1-release-win32_rubenvb.7z/download

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.

http://www.pasteall.org/38312/diff

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?
Reply with quote


mcleary

Posted: Sun Jan 06, 2013 3:21 pm
Joined: 05 Jan 2013
Posts: 8
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
Reply with quote


stiv

Posted: Sun Jan 06, 2013 5:33 pm
Joined: 05 Aug 2003
Posts: 3645
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.
Reply with quote


greatwolf

Posted: Tue Jan 22, 2013 2:08 am
Joined: 04 Dec 2012
Posts: 3
Well I found out the root cause for the crash: Mingw64-32bit compiler comes with it's own pthread named
Code:
libwinpthread-1.dll
. 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.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group