# Component build warning and error from Simulink

**URL:** <https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185>\
**Category:** General\
**Created:** [June 10, 2025, 3:07pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185 "2025-06-10T15:07:26Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 10, 2025, 3:07pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/1 "2025-06-10T15:07:26Z")

</div>

Hi I face some errors on component building from Simulink with rtMaps.tlc.  
I use MATLAB 2025a.  
I see the following errors on the building phase. I see error C2440 and NMAKE : fatal error U1077, do you see the root cause?  
And the rtmaps.tlc may be a bit old against to r2025a because I see the following warnings:  
Can you try simple component building with r2025a first? I believe the warnings will reproduce with very simple models.

"Warning:Update the system target file ‘rtmaps.tlc’ to support the enhanced TLC block interface for code generation.  
This update improves the efficiency of generated code for many Simulink blocks and user-defined S-Function blocks.  
Failure to update the system target file might result in build errors and disruptions in code generation in future releases.  
For instructions on enabling the interface, see Enable the Enhanced TLC Block Interface.  
"

"Warning:Warning: Found legacy make variables |\>START\_MDLREFINC\_EXPAND\_INCLUDES\<|, |\>END\_MDLREFINC\_EXPAND\_INCLUDES\<|, |\>MODELREF\_INC\_PATH\<| in template makefile C:\Program Files\Intempora\RTMaps 4\tools\simulink\rtmaps\_tlc\_target\rtmaps\_tlc\rtmaps\_vc\_v2.tmf. You can remove the variables.  
"

> Blockquote  
> C:\PROGRA~1\MATLAB\R2025A~1\toolbox\shared\robotics\externalDependency\amcl-localization\src\amcl\map\amcl\_map\_store.c(88): error C2440: ‘=’: ‘void \*’ ���� ‘map\_cell\_t _’ �ɕϊ��ł��܂���B  
> C:\PROGRA~1\MATLAB\R2025A~1\toolbox\shared\robotics\externalDependency\amcl-localization\src\amcl\map\amcl\_map\_store.c(88): note: 'void_’ ����� ‘void’ �^�ւ̕ϊ��ɂ͖����I�ȃL���X�g���K�v�ł��B  
> C:\PROGRA~1\MATLAB\R2025A~1\toolbox\shared\robotics\externalDependency\amcl-localization\src\amcl\map\amcl\_map\_store.c(55): warning C4996: ‘fopen’: This function or variable may be unsafe. Consider using fopen\_s instead. To disable deprecation, use \_CRT\_SECURE\_NO\_WARNINGS. See online help for details.  
> C:\PROGRA~1\MATLAB\R2025A~1\toolbox\shared\robotics\externalDependency\amcl-localization\src\amcl\map\amcl\_map\_store.c(58): warning C4996: ‘strerror’: This function or variable may be unsafe. Consider using strerror\_s instead. To disable deprecation, use \_CRT\_SECURE\_NO\_WARNINGS. See online help for details.  
> C:\PROGRA~1\MATLAB\R2025A~1\toolbox\shared\robotics\externalDependency\amcl-localization\src\amcl\map\amcl\_map\_store.c(64): warning C4996: ‘fscanf’: This function or variable may be unsafe. Consider using fscanf\_s instead. To disable deprecation, use \_CRT\_SECURE\_NO\_WARNINGS. See online help for details.  
> C:\PROGRA~1\MATLAB\R2025A~1\toolbox\shared\robotics\externalDependency\amcl-localization\src\amcl\map\amcl\_map\_store.c(76): warning C4996: ‘fscanf’: This function or variable may be unsafe. Consider using fscanf\_s instead. To disable deprecation, use \_CRT\_SECURE\_NO\_WARNINGS. See online help for details.  
> NMAKE : fatal error U1077: ‘cl -c -nologo -GS -W4 -DWIN32 -D\_MT -MT -Od -DLIBRARY\_EXPORTS -D\_USE\_MATH\_DEFINES -DTID01EQ=0 /MD /TP /INCLUDE:MAPSPckInit /INCLUDE:MAPSGetModulesDefStruct -DUSE\_RTMODEL -DMODEL=adaptivemcl -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -DHAVESTDIO -DMAT\_FILE=0 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI\_INSTANCE\_CODE=1 -DCLASSIC\_INTERFACE=0 -DALLOCATIONFCN=0 C:\PROGRA~1\MATLAB\R2025A~1\toolbox\shared\robotics\externalDependency\amcl-localization\src\amcl\map\amcl\_map\_store.c’ : ���^�[�� �R�[�h ‘0x2’  
> Blockquote

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 10, 2025, 3:10pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/2 "2025-06-10T15:10:58Z")

</div>

I see some warnings even with the attached simple model.

 ![image](https://forum.rtmaps.com/uploads/default/original/1X/c48ff6ae1bbe2d57e0b3f4cf8bc38a8cda0c0f42.png)

---

<div class="post-metadata">

**Author:** ![max](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/max/32/31_2.png) [@max](https://forum.rtmaps.com/u/max)\
**Post date:** [June 10, 2025, 6:37pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/3 "2025-06-10T18:37:28Z")

</div>

Hi @Shogo

Thanks for reporting this.  
We published an update ([v3.2.2 of the mathworks package](https://dl.intempora.com/rtmaps_update_site/archives/rtmaps_pck_rtmaps_mathworks_3.22.2_windows_x86_64.zip)). The warning related to the “Enhanced TLC Block Interface” is resolved.

But regarding the build error, it seems to come from dependencies outside of RTMaps:

> C:\PROGRA~1\MATLAB\R2025A~1\toolbox\shared\robotics\externalDependency\

And for the makefile warnings, I can’t reproduce it. What version of Visual Studio are you using?

Best regards,

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 11, 2025, 12:32am UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/4 "2025-06-11T00:32:10Z")

</div>

Hi thank you for your reply.  
I also see some warnings have gone away from the simple model.  
I still see the following warning in the simple mode. Let’s discuss the warnings first.  
I use VS2022 community on WIndows11, it may be related the OS support warning at least.

> Blockquote  
> Warning: Found legacy make variables |\>START\_MDLREFINC\_EXPAND\_INCLUDES\<|, |\>END\_MDLREFINC\_EXPAND\_INCLUDES\<|, |\>MODELREF\_INC\_PATH\<| in template makefile C:\Program Files\Intempora\RTMaps 4\tools\simulink\rtmaps\_tlc\_target\rtmaps\_tlc\rtmaps\_vc\_v2.tmf. You can remove the variables.  
> Regroup 4 similar  
> Warning: Found legacy make variables |\>MASTER\_ANCHOR\_DIR\<| in template makefile C:\Program Files\Intempora\RTMaps 4\tools\simulink\rtmaps\_tlc\_target\rtmaps\_tlc\rtmaps\_vc\_v2.tmf. You can remove the variables.  
> Warning: Found legacy make variables |\>S\_FUNCTIONS\<|, |\>S\_FUNCTIONS\_OBJ\<| in template makefile C:\Program Files\Intempora\RTMaps 4\tools\simulink\rtmaps\_tlc\_target\rtmaps\_tlc\rtmaps\_vc\_v2.tmf. You can remove the variables.  
> Warning: Found legacy make variables |\>SHARED\_BIN\_DIR\<|, |\>SHARED\_LIB\<|, |\>SHARED\_SRC\<|, |\>SHARED\_SRC\_DIR\<| in template makefile C:\Program Files\Intempora\RTMaps 4\tools\simulink\rtmaps\_tlc\_target\rtmaps\_tlc\rtmaps\_vc\_v2.tmf. You can remove the variables.

another warning

> Blockquote  
> The following error occurred while attempting to run the preprocessor to find the minimum needed set of include files:  
> While parsing the source file ‘D:\dspace\rtmaps\gc1\_rtmaps\_build\maps\_gc1.cpp’ the following error occurred  
> C:\Program Files\Intempora\RTMaps 4\sdk\vc.net2022\_x64\include\maps\_os\_helpers.hpp:611:error: #error directive: “OS not supported”  
> | # error “OS not supported”  
> | ^  
> Reverting to full header search.  
> Component:Simulink | Category:Model warning

---

<div class="post-metadata">

**Author:** ![max](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/max/32/31_2.png) [@max](https://forum.rtmaps.com/u/max)\
**Post date:** [June 12, 2025, 8:07am UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/5 "2025-06-12T08:07:20Z")

</div>

I can’t reproduce these warnings and errors on my Windows 10 & VS 2022 setup. I’m trying to upgrade to Windows 11, maybe I’ll get the issue then.

In the meantime, to be sure, is the right compiler configured in Matlab? Have you run `mex -setup C` and `mex -setup C++` in the Matlab console?

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 12, 2025, 8:33am UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/6 "2025-06-12T08:33:07Z")

</div>

@max

I set the mex setup again but see no change.WIndows11 may be the root cause.  
Anyway I wait for your update of the environment for the point.

And one more question, can I build the generated codes in VS2022, not on Simulink?  
I see the .mk file in the generated folder but no .sln file.  
Beside of the listed warnings, I can investigate the detail of errors if I can build them in VS.

---

<div class="post-metadata">

**Author:** ![max](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/max/32/31_2.png) [@max](https://forum.rtmaps.com/u/max)\
**Post date:** [June 12, 2025, 9:54am UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/7 "2025-06-12T09:54:58Z")

</div>

@Shogo  
It is possible to use CMake to generate the .sln file.  
Here is our template CMakeLists.txt, modified for this use case: [CMakeLists.txt - Intempora Nextcloud](https://dl2.intempora.com/index.php/s/QxYFsJ8Y9JmMRPg)  
Put it in the generated code folder, and modify the PCK variable to your project name, and the matlab path if different.

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 12, 2025, 11:11am UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/8 "2025-06-12T11:11:22Z")

</div>

Hi thank you for your quick reply.  
I tested the attached cmakelist.txt and face version error.

In the line 1 of cmakelist, the minumum version is defined as 2.8.12 but I see the following error.

> Blockquote  
> CMake Error at CMakeLists.txt:1 (cmake\_minimum\_required):  
> Compatibility with CMake \< 3.5 has been removed from CMake.

When I change the version in line 1, I see another version error during  
“cmake -B build”

> Blockquote  
> CMake Error at C:/Program Files/Intempora/RTMaps 4/templates.u/rtmaps.cmake:1 (cmake\_minimum\_required):  
> Compatibility with CMake \< 3.5 has been removed from CMake.

I guess the version issue is in the installation folder on my environment.  
Can you also check the behavior on your new environment?  
It is an option to use cmake v2.8 but the version may be too old.

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 14, 2025, 1:45am UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/9 "2025-06-14T01:45:01Z")

</div>

Hi, I got success to create .sln file with the following command.

> cmake -B build -DCMAKE\_POLICY\_VERSION\_MINIMUM=3.5

I concluded the root cause is internal version minimum policy, I expect you to update the policy for each internal .cmake files later.  
Next, I will try unify multiple models to one .sln file.  
If it is possible automatically i.e. enable registering the code generation folder to a specific pck project folder, it would be much helpful.

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 14, 2025, 2:05pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/10 "2025-06-14T14:05:51Z")

</div>

Hi I got success merging projects manually.  
Though I may need additional care when external libraries are used, I simply added source codes to the .sln fine this time.

The left issues, warnings on Windows11 and version compatibility on cmakelist.

---

<div class="post-metadata">

**Author:** ![max](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/max/32/31_2.png) [@max](https://forum.rtmaps.com/u/max)\
**Post date:** [June 18, 2025, 9:08am UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/11 "2025-06-18T09:08:44Z")

</div>

Hi,

I’m glad you could work around the issues.

I don’t think it is possible to automatically merge generated code projects. Mathworks seems to advise to do it manually: [https://fr.mathworks.com/help/rtw/ug/combined-models.html](https://fr.mathworks.com/help/rtw/ug/combined-models.html)

Regarding the .tmf makefile warnings, I could reproduce it with Windows 11. I updated our template Makefile to reflect changes with the version provided with Matlab R2025a, which corrects the warnings. I could not reproduce the build errors. Hopefully the new makefile fixes it for you, please let me know. The new version 3.22.3 of the Mathworks package is available on our update site ([https://dl.intempora.com/rtmaps\_update\_site/archives/rtmaps\_pck\_rtmaps\_mathworks\_3.22.3\_windows\_x86\_64.zip](https://dl.intempora.com/rtmaps_update_site/archives/rtmaps_pck_rtmaps_mathworks_3.22.3_windows_x86_64.zip))

The CMake compatibility issue is in our backlog, to be fixed for the next release of RTMaps.

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 18, 2025, 2:13pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/12 "2025-06-18T14:13:26Z")

</div>

Hi I see some warnings have gone away but see the OS version warning still  
and new warnings come, which may not be significant.  
The generated makefile should be improved, I will test it soon.

> Blockquote  
> [C:\PROGRA~1\MATLAB\R2025A~1\rtw\c\src\common\rt\_cppclass\_main.cpp(491)](matlab: opentoline(‘C:%5cPROGRA~1%5cMATLAB%5cR2025A~1%5crtw%5cc%5csrc%5ccommon%5crt\_cppclass\_main.cpp’,491,1);): warning C4127:

> Blockquote  
> The following error occurred while attempting to run the preprocessor to find the minimum needed set of include files:  
> While parsing the source file ‘D:\MCL\b1\_rtmaps\_build\maps\_b1.cpp’ the following error occurred  
> C:\Program Files\Intempora\RTMaps 4\sdk\vc.net2022\_x64\include\maps\_os\_helpers.hpp:611:error: #error directive: “OS not supported”  
> | # error “OS not supported”  
> | ^

Do you see same warnings?

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 18, 2025, 2:24pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/13 "2025-06-18T14:24:42Z")

</div>

The " rt\_cppclass\_main.cpp" is generated by Simulink coder to show an example of main program to use the generated codes.  
I believe It is not used for rtmaps build, which has low priority.  
The OS version warning also may cause no issue, but I think it is not good appearing every time on Windows11.

---

<div class="post-metadata">

**Author:** ![max](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/max/32/31_2.png) [@max](https://forum.rtmaps.com/u/max)\
**Post date:** [June 18, 2025, 2:56pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/14 "2025-06-18T14:56:10Z")

</div>

I’m not sure I understand. The “OS not supported” message is an error, not a warning. Does the package compile correctly anyway? Then I’m not sure at which step this message comes from. Can you share your full log from Simulink Coder? I couldn’t reproduce this error on my Windows 11.

Regarding rt\_cppclass\_main.cpp I see a similar message:  
`C:\PROGRA~1\MATLAB\R2025a\rtw\c\src\common\rt_cppclass_main.cpp(491): note: consider using 'if constexpr' statement instead`  
But there is not much I can do, it is provided by Mathworks, and is necessary in the package compilation.

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [June 18, 2025, 4:08pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/15 "2025-06-18T16:08:45Z")

</div>

I see the generated pck file even with the warning.

 ![image](https://forum.rtmaps.com/uploads/default/original/1X/05cbaf100701bb0f75ed26a4c50bdb0e328fafff.png)

I uploaded my model and build log in the drobox folder.  
Can you find the files?

> **[Dropbox](https://www.dropbox.com/scl/fo/vodue916ugc4bucf65hov/AIEslXzYgoTYUoxZ0z7wfrE?rlkey=k2bk70uz13mqhzoss6r4pweqs&st=is56f9r0&dl=0)**

---

<div class="post-metadata">

**Author:** ![Shogo](https://forum.rtmaps.com/user_avatar/forum.rtmaps.com/shogo/32/110_2.png) [@Shogo](https://forum.rtmaps.com/u/Shogo)\
**Post date:** [July 5, 2025, 12:16pm UTC](https://forum.rtmaps.com/t/component-build-warning-and-error-from-simulink/185/16 "2025-07-05T12:16:52Z")

</div>

Hi I got progress.  
I removed the build error on Visual studio with some code change.

I also see build error with VC++ even with grt.tlc, so there may be some issues on VC++ as the mex compiler or the generated codes. It may be out of rtmaps.tlc.  
I consider to report the issue to MW in the future.

The remaining issues are the warnings on building, but it is not so significant.  
If you get any progress, let me know it.
