C or C++ Code Generation and Integration in Stateflow

Ok, here is a fine example of errors I've got to ilustrate what is my problem
I made a "C" wrapper for some arduino Liquid cristal functions and simle put a call into a StateFlow chart. The chart parsing gave no errors.

I got those under C source generation. Those are repeating for all declaration line in pgmspace.h file.
I think the code generation process lost or mixed the selection of AVR and Arduino toolchains and includes wrong files or in wrong order??? I have no clue how could I correct it.

d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(211) : error C2146: syntax error : missing ';' before identifier 'attribute'
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(211) : error C2065: 'progmem' : undeclared identifier
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(211) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(212) : error C2146: syntax error : missing ';' before identifier 'attribute'
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(212) : error C2065: 'progmem' : undeclared identifier
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(212) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(212) : error C2374: 'attribute' : redefinition; multiple initialization
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(211) : see declaration of 'attribute'
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(213) : error C2146: syntax error : missing ';' before identifier 'attribute'
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(213) : error C2065: 'progmem' : undeclared identifier
d:_Store\dokumentumok\MATLAB\Arduino\Try_06\avr/pgmspace.h(213) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int