How can I solve the compiler error in "rt_nonfinite.h" ?

18 views (last 30 days)
I generated code from a simulink model using "create with Visual C solution file for embedded coder" with ert.tlc / Matlab 2013b 32bit. Then I have tried to call this code using matlab function block in simulink. I have included the necessary header and source file into simulation target->custom code under configuration parameters. Header files are;
#include "rt_defines.h"
#include "rt_nonfinite.h"
#include "rtGetInf.h"
#include "rtGetNaN.h"
#include "rtwtypes.h"
#include "TRUBA_3DOF.h"
#include "TRUBA_3DOF_Entry.h"
#include "TRUBA_3DOF_private.h"
#include "TRUBA_3DOF_types.h"
and the source files are;
rt_nonfinite.c
rtGetInf.c
rtGetNaN.c
TRUBA_3DOF.c
TRUBA_3DOF_Entry.c
TRUBA_3DOF_data.c
When I run the simulink model I get the following error:
Making simulation target "Call_3DOF_sfun", ...
Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
### Compiling "Call_3DOF_sfun.c"
cl.exe /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /I "d:\hasan_matpan_rs\truba_3dof\slprj\_sfprj\call_3dof\_self\sfun\src" /I "d:\hasan_matpan_rs\truba_3dof" /I "d:\hasan_matpan_rs\truba_3dof\truba_3dof_ert_rtw" /I "C:\Program Files (x86)\MATLAB\R2013b\extern\include" /I "C:\Program Files (x86)\MATLAB\R2013b\simulink\include" /I "C:\Program Files (x86)\MATLAB\R2013b\rtw\c\src" /I "C:\Program Files (x86)\MATLAB\R2013b\stateflow\c\mex\include" /I "C:\Program Files (x86)\MATLAB\R2013b\stateflow\c\debugger\include" /I "C:\Program Files (x86)\MATLAB\R2013b\toolbox\stateflow\src\sf_runtime\export\include\sf_runtime" "Call_3DOF_sfun.c"
Call_3DOF_sfun.c
d:\hasan_matpan_rs\truba_3dof\truba_3dof_ert_rtw\rt_nonfinite.h(22) : error C2059: syntax error : '-'
d:\hasan_matpan_rs\truba_3dof\truba_3dof_ert_rtw\rt_nonfinite.h(28) : error C2059: syntax error : 'type'
d:\hasan_matpan_rs\truba_3dof\truba_3dof_ert_rtw\rt_nonfinite.h(30) : error C2059: syntax error : 'type'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe"' : return code '0x2'
Stop.
*********************************************************************
The content of the rt_nonfinite_h is attached.
Thanks for your replies.
  2 Comments
Walter Roberson
Walter Roberson on 13 Dec 2015
I wonder if it would help to #include rt_nonfinite before rt_defines ? That is I wonder if rt_defines is defining some tokens that end up being used in rt_nonfinite and so changing what we see?
Brandon Smith
Brandon Smith on 28 Jul 2020
I am trying to do the same thing in Matlab 2020a and VS2019, and running into the identical error code. Was this ever resolved?

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!