Why Rapid Accelerator Simulation fails with Visual Studio Compiler error: "rt_nonfinite.c(4): error C2099: initializer is not a constant rt_nonfinite.c(5): error C2099: initializer is not a constant" ?

9 ビュー (過去 30 日間)
I got the following error message when run Rapid Accelerator simulation using Windows SDK Version 10.0.26100.0.
** Error message **
cl -c -nologo -GS -W4 -DWIN32 @test_comp.rsp -D_MT -D_DLL -MD -D_CRT_SECURE_NO_WARNINGS -DTGTCONN -DIS_SIM_TARGET -DNRT -DRSIM_PARAMETER_LOADING -DRSIM_WITH_SL_SOLVER -DUSE_LOCALHOST -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=1 /DNDEBUG /Od /Oy- -DMODEL=test -DNUMST=2 -DNCSTATES=0 -DMAT_FILE=1 -DINTEGER_CODE=0 -DONESTEPFCN=0 -DTERMFCN=1 -DHAVESTDIO -DMULTI_INSTANCE_CODE=0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DEXT_MODE -DIS_RAPID_ACCEL -DHAVESTDIO -DMT=0 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 rt_nonfinite.c
rt_nonfinite.c
rt_nonfinite.c(4): error C2099: initializer is not a constant
rt_nonfinite.c(5): error C2099: initializer is not a constant
NMAKE : fatal error U1077: 'cl -c -nologo -GS -W4 -DWIN32 @test_comp.rsp -D_MT -D_DLL -MD -D_CRT_SECURE_NO_WARNINGS -DTGTCONN -DIS_SIM_TARGET -DNRT -DRSIM_PARAMETER_LOADING -DRSIM_WITH_SL_SOLVER -DUSE_LOCALHOST -DENABLE_SLEXEC_SSBRIDGE=1 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=0 -DTID01EQ=1 /DNDEBUG /Od /Oy- -DMODEL=test -DNUMST=2 -DNCSTATES=0 -DMAT_FILE=1 -DINTEGER_CODE=0 -DONESTEPFCN=0 -DTERMFCN=1 -DHAVESTDIO -DMULTI_INSTANCE_CODE=0 -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DEXT_MODE -DIS_RAPID_ACCEL -DHAVESTDIO -DMT=0 -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 rt_nonfinite.c ' : return code '0x2'
Stop.
**

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 1 月 31 日 0:00
Given this is a bug specific to Windows SDK version 10.0.26100.0 as described in https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907 .
To work around the MSVC bug when generating code for a model, do one of the following:
  • Add the compiler option -D_UCRT_NOISY_NAN to the C Compiler or C++ Compiler option listed for model configuration parameter Toolchain details.
    • To change settings of model configuration parameter Toolchain details, you might need to set model configuration parameter Build configuration to Specify.
  • Set model configuration parameter Language standard to C89/C90 (ANSI) or C++03 (ISO)
    OR
  • Select a different compiler, such as MinGW, or roll back the MSVC SDK to an earlier version

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeploy to C++ Applications Using mwArray API (C++03) についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by