Error compiling Cannot open include file and RTW errors

29 views (last 30 days)
I have a problem building my code. I use the code from a coworker who is using Matlab 2016a. I now use his code on my Matlab 2017b. I can't find a solution anywhere. Anyone have a idea how to solve this issue?
While compiling I get the following error below:
C:\PROGRA~1\MATLAB\R2017b\toolbox\rtw\targets\xpc\target\build\xpcobsolete\encconteccnt328mpci.c(28): fatal error C1083: Cannot open include file: 'include/cnt328mpci.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.EXE"' : return code '0x2'
Stop.
The make command returned an error of 2
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.
Error using RTW/genMakefileAndBuild>invokeTMF
Error(s) encountered while building "Long_stroke_test_setup_R2017b"
Error in RTW/genMakefileAndBuild
Error in RTW/genMakefileAndBuildWrapper
Error in coder.internal.compileStage
Error in coder.internal.ModelBuilder/buildProcedure (line 1107)
compileResult = coder.internal.compileStage...
Error in coder.internal.ModelBuilder/make_rtw (line 197)
buildResult = buildProcedure...
Error in coder.internal.ModelCodegenMgr/make_rtw (line 8)
buildResult = obj.make_rtw(varargin);
Error in make_rtw (line 20)
buildResult = h.make_rtw(buildArgs, varargin{:});
Error in build_target
Error in build_target
Error in build_standalone_rtw_target
Error in slbuild_private
Error in slbuild_private
Error in sl (line 15)
[varargout{1:nargout}]=feval(varargin{:});
Error in slbuild (line 72)
sl('slbuild_private', mdl, target, varargin{2:end});
Error in rtwbuild (line 217)
slbuild(sys, 'StandaloneRTWTarget', ...
Error in Long_stroke_test_setup_R2017b (line 21)
rtwbuild('Long_stroke_test_setup_R2017b'); % Build Simulink scheme
  2 Comments
Walter Roberson
Walter Roberson on 27 Aug 2018
How old is that code? The only reference I find to that include file is in the google cache of a single location that was using an 2008 version of rtw.

Sign in to comment.

Answers (1)

Amal George M
Amal George M on 31 Aug 2018
Edited: Amal George M on 31 Aug 2018
It looks like in Simulink Real-Time R2017b, there is an issue in the way the "CNT32-8M(PCI)" block refers to a header file.
The source code of this block in local directory toolbox\rtw\targets\xpc\target\build\xpcobsolete\encconteccnt328mpci.c on line 28 refers to: #include "include/cnt328mpci.h"
But, I believe it should be referring to the header as follows: #include "cnt328mpci.h"
To work around this issue, you may consider changing this line as described above.

Categories

Find more on Downloads in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!