Is there a way to increase the stack size of a Windows application at compile/link time with GCC?
When creating threads you use the dwStackSize paremater, but I'm not sure how to change the size for the main thread, this indicates its in the exe's header, so it may be an option for the compiler/linker, else you need to find the relevant part of the header and change it yourself.
http://msdn.microsoft.com/en-us/library/ms686774(VS.85).aspx