Simulink compilation doesn't find string.h

20 views (last 30 days)
syl1446
syl1446 on 2 Oct 2019
Answered: Chaitanya Mallela on 30 Dec 2020
When trying to compile a Simulink model, I get the error: "C1083: Cannot open include file: 'string.h': No such file or directory" during the compilation of one of the sub-models. The header is located in "C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt" but Matlab doesn't seem to be able to find it. I've tried to add this path to the includes search path by adding it to 'Model Configuration Parameters > Simulation Target > Include directories'. I've also tried to pass it directly to the toolchain by choosing 'Specify' for "Model Configuration Parameters > Code Generation > Build configuration" and adding the path prepended by '-I' (capital i) to 'C Compiler' and 'C++ Compiler'. None of these attempts worked.
How can I tell Simulink where to look for this file ?
I use Matlab 2018b on Windows 7 with Visual C++ 2017 v15.0.
Thanks

Answers (1)

Chaitanya Mallela
Chaitanya Mallela on 30 Dec 2020
you can specify the C header file for simulation in the Simulation Target pane of the Model Configuration Parameters dialog box.
#include <string.h>
To access C source and header files outside your working folder, list the path in the Simulation Target pane, in the Include Directories text box.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!