I have the same problem with Ardupilot Mega 2.5 + . I have checked and rechecked everything and while compiling it still gives the same message. "The call to realtime_make_rtw_hook, during the after_make hook generated the following error: The build failed with the following message: "C:/MATLAB/Targets/R2012a/arduino-1.0/hardware/tools/avr/bin/avr-gcc" -I"C ..... Anybody please help ? I am usinghttp://www.mathworks.com/matlabcentral/fileexchange/39037-apm2-simulink-blockset for my work.I have followed all the instructions properly.