MATLAB: Problem in 2012b with SDK 7.1

2014bbuildingerrorMATLABmicrosoft sdk7.1simulinksimulink coder

I am having problems building in 2012b 64bit. I have read at least 10 posts with the same problem, but no real answer. The only possible answer I have found is to set my target to xpctarget.tlc instead of ert.tlc, but that is not in my option list. How do I add it and if I do, will it affect my build in any way? On my last PC, I could build just fine, but I was running 2011b 32bit running the included compiler (not SDK7.1). This code is in production and I need to modify it, but can't alter its function in any way, so I want to make sure changing the target tlc file will not alter it.
Here are the error codes I got leading up to the error.
c:\program files\matlab\r2012b\extern\include\matrix.h(314) : error C2061: syntax error : identifier 'mxLogical'
c:\program files\matlab\r2012b\extern\include\matrix.h(314) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(319) : error C2061: syntax error : identifier 'mxChar'
c:\program files\matlab\r2012b\extern\include\matrix.h(319) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(427) : error C2061: syntax error : identifier 'mxIsNumeric'
c:\program files\matlab\r2012b\extern\include\matrix.h(427) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(427) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(433) : error C2061: syntax error : identifier 'mxIsCell'
c:\program files\matlab\r2012b\extern\include\matrix.h(433) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(433) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(439) : error C2061: syntax error : identifier 'mxIsLogical'
c:\program files\matlab\r2012b\extern\include\matrix.h(439) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(439) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(445) : error C2061: syntax error : identifier 'mxIsChar'
c:\program files\matlab\r2012b\extern\include\matrix.h(445) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(445) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(451) : error C2061: syntax error : identifier 'mxIsStruct'
c:\program files\matlab\r2012b\extern\include\matrix.h(451) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(451) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(457) : error C2061: syntax error : identifier 'mxIsOpaque'
c:\program files\matlab\r2012b\extern\include\matrix.h(457) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(457) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(463) : error C2061: syntax error : identifier 'mxIsFunctionHandle'
c:\program files\matlab\r2012b\extern\include\matrix.h(463) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(463) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(471) : error C2061: syntax error : identifier 'mxIsObject'
c:\program files\matlab\r2012b\extern\include\matrix.h(471) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(472) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(496) : error C2061: syntax error : identifier 'mxIsComplex'
c:\program files\matlab\r2012b\extern\include\matrix.h(496) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(496) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(502) : error C2061: syntax error : identifier 'mxIsSparse'
c:\program files\matlab\r2012b\extern\include\matrix.h(502) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(502) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(509) : error C2061: syntax error : identifier 'mxIsDouble'
c:\program files\matlab\r2012b\extern\include\matrix.h(509) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(509) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(516) : error C2061: syntax error : identifier 'mxIsSingle'
c:\program files\matlab\r2012b\extern\include\matrix.h(516) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(516) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(523) : error C2061: syntax error : identifier 'mxIsInt8'
c:\program files\matlab\r2012b\extern\include\matrix.h(523) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(523) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(530) : error C2061: syntax error : identifier 'mxIsUint8'
c:\program files\matlab\r2012b\extern\include\matrix.h(530) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(530) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(537) : error C2061: syntax error : identifier 'mxIsInt16'
c:\program files\matlab\r2012b\extern\include\matrix.h(537) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(537) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(544) : error C2061: syntax error : identifier 'mxIsUint16'
c:\program files\matlab\r2012b\extern\include\matrix.h(544) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(544) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(551) : error C2061: syntax error : identifier 'mxIsInt32'
c:\program files\matlab\r2012b\extern\include\matrix.h(551) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(551) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(558) : error C2061: syntax error : identifier 'mxIsUint32'
c:\program files\matlab\r2012b\extern\include\matrix.h(558) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(558) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(565) : error C2061: syntax error : identifier 'mxIsInt64'
c:\program files\matlab\r2012b\extern\include\matrix.h(565) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(565) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(572) : error C2061: syntax error : identifier 'mxIsUint64'
c:\program files\matlab\r2012b\extern\include\matrix.h(572) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(572) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(578) : error C2061: syntax error : identifier 'mxGetNumberOfDimensions_730'
c:\program files\matlab\r2012b\extern\include\matrix.h(578) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(578) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(584) : error C2143: syntax error : missing '{' before '*'
c:\program files\matlab\r2012b\extern\include\matrix.h(632) : error C2143: syntax error : missing '{' before '*'
c:\program files\matlab\r2012b\extern\include\matrix.h(676) : error C2061: syntax error : identifier 'mxIsFromGlobalWS'
c:\program files\matlab\r2012b\extern\include\matrix.h(676) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(676) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(682) : error C2146: syntax error : missing ')' before identifier 'global'
c:\program files\matlab\r2012b\extern\include\matrix.h(682) : error C2081: 'bool' : name in formal parameter list illegal
c:\program files\matlab\r2012b\extern\include\matrix.h(682) : error C2061: syntax error : identifier 'global'
c:\program files\matlab\r2012b\extern\include\matrix.h(682) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(682) : error C2059: syntax error : ')'
c:\program files\matlab\r2012b\extern\include\matrix.h(694) : error C2146: syntax error : missing ')' before identifier 'm'
c:\program files\matlab\r2012b\extern\include\matrix.h(694) : error C2081: 'mwSize' : name in formal parameter list illegal
c:\program files\matlab\r2012b\extern\include\matrix.h(694) : error C2061: syntax error : identifier 'm'
c:\program files\matlab\r2012b\extern\include\matrix.h(694) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(694) : error C2059: syntax error : ')'
c:\program files\matlab\r2012b\extern\include\matrix.h(706) : error C2061: syntax error : identifier 'mxIsEmpty'
c:\program files\matlab\r2012b\extern\include\matrix.h(706) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(707) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(714) : error C2143: syntax error : missing '{' before '*'
c:\program files\matlab\r2012b\extern\include\matrix.h(720) : error C2143: syntax error : missing ')' before '*'
c:\program files\matlab\r2012b\extern\include\matrix.h(720) : error C2081: 'mwIndex' : name in formal parameter list illegal
c:\program files\matlab\r2012b\extern\include\matrix.h(720) : error C2143: syntax error : missing '{' before '*'
c:\program files\matlab\r2012b\extern\include\matrix.h(720) : error C2059: syntax error : ')'
c:\program files\matlab\r2012b\extern\include\matrix.h(726) : error C2143: syntax error : missing '{' before '*'
c:\program files\matlab\r2012b\extern\include\matrix.h(732) : error C2143: syntax error : missing ')' before '*'
c:\program files\matlab\r2012b\extern\include\matrix.h(732) : error C2081: 'mwIndex' : name in formal parameter list illegal
c:\program files\matlab\r2012b\extern\include\matrix.h(732) : error C2143: syntax error : missing '{' before '*'
c:\program files\matlab\r2012b\extern\include\matrix.h(732) : error C2059: syntax error : ')'
c:\program files\matlab\r2012b\extern\include\matrix.h(738) : error C2061: syntax error : identifier 'mxGetNzmax_730'
c:\program files\matlab\r2012b\extern\include\matrix.h(738) : error C2059: syntax error : ';'
c:\program files\matlab\r2012b\extern\include\matrix.h(738) : error C2059: syntax error : 'type'
c:\program files\matlab\r2012b\extern\include\matrix.h(744) : error C2146: syntax error : missing ')' before identifier 'nzmax'
c:\program files\matlab\r2012b\extern\include\matrix.h(744) : error C2081: 'mwSize' : name in formal parameter list illegal
c:\program files\matlab\r2012b\extern\include\matrix.h(744) : error C2061: syntax error : identifier 'nzmax'
c:\program files\matlab\r2012b\extern\include\matrix.h(744) : fatal error C1003: error count exceeds 100; stopping compilation
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl.exe"' : return code '0x2'
Stop.

Best Answer

Ok, I am still verifying the result, but the build process works fine now. I had an older version of tmwtypes.h in my build folder. The only thing I did to fix the build was to replace it with the current version of tmwtypes.h in the root Matlab folder.
Like I said though, I am still verifying it on hardware to make sure the functionality is the same. I will report back in a couple of days.
Related Question