Simulink complains that the file allegedly has no mdlDerivatives function when compiled for 32bit Matlab 2007b with gcc. The same file worked well when compiled with Visual Studio 2005 for 32bit or with the gcc for 64bit Matlab2014a. The following tests show which combination works and wich not. The used minimal working example can be found in the attachment.
MinGW-W64 gcc 4.9 for 64bit Matlab2014a -> works
MinGW-W64(32bit) gcc 4.9 for 32bit Matlab2007b -> S-function 'mwe' in 'mwe2007b/S-Function' has continuous states, but doesn't have a mdlDerivatives routine.
VisualStudio 2005 for 32bit Matlab2007b -> works
TDM-MinGW gcc 4.8.1 for 32bit Matlab 2007b --> works
So is there an error with the 32bit version of the gcc 4.9 or does it need special handling by gnumex?