Simulink Coder - Cannot open include file: 'nesl_rtw.h'

14 ビュー (過去 30 日間)
Istvan Burbank
Istvan Burbank 2015 年 8 月 4 日
回答済み: Michael Burke 2019 年 1 月 4 日
I am using Simulink Coder to compile my simulink model into a shared library (embedded target) which I then try to load into MATLAB using coder.loadlibrary. Upon executing the following command, I get an error:
libModelPath = fullfile(pwd, 'mylib_ert_shrlib_rtw');
libSimulinkPath = fullfile(matlabroot, 'simulink', 'include');
hfile = fullfile(libModelPath, 'mylib.h');
coder.loadlibrary('mylib_win64', hfile, ...
'includepath', libModelPath, ...
'includepath', libSimulinkPath, ...
'mfilename', 'testfile', ...
'alias', 'mylibrary')
The error I get is:
coder.loadlibrary('mylib, hfile)
Error using loadlibrary (line 447)
Failed to preprocess the input file.
Output from preprocessor is:'mylib.h
: fatal error C1083: Cannot open include file: 'nesl_rtw.h': No such file or directory
Lines 18-30 of mylib.h:
#ifndef RTW_HEADER_mylib_h_
#define RTW_HEADER_mylib_h_
#include <math.h>
#include <float.h>
#include <string.h>
#ifndef mylib_COMMON_INCLUDES_
# define mylib_COMMON_INCLUDES_
#include "rtwtypes.h"
#include "rtw_continuous.h"
#include "rtw_solver.h"
#include "nesl_rtw.h"
#include "mylib_8bed9f9f_gateway.h"
#endif /* mylib_COMMON_INCLUDES_ */
A quick search of my system doesn't produce a file named nesl_rtw.h.

回答 (2 件)

zijin wang
zijin wang 2017 年 4 月 26 日

Michael Burke
Michael Burke 2019 年 1 月 4 日
The nesl_rtw.h file is part of the
Directory where <ARCH> is the architecture you are running on the "ARCH" will change.
Note: You may need to include additional directories. You can search the MATLAB path using the internal file search tool

Community Treasure Hunt

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

Start Hunting!

Translated by