R2017b Visual Studio 2017 can't link model files when compiling simulink

1 回表示 (過去 30 日間)
Michael Krastev
Michael Krastev 2017 年 11 月 13 日
回答済み: Nick Choi 2017 年 11 月 16 日
I have Visual Studio 2017 and R2017b, mex and slrtgetCC both recognise the tool set, mex happily complies simple .c files.
When I build the model however it crashes out
NMAKE : fatal error U1052: file 'model.mk' not found
Followed by
Validation error(s):
### Validating other build tools ...
Unable to locate build tool "Microsoft Visual C Compiler": cl
Unable to locate build tool "Microsoft Visual C Linker": link
Unable to locate build tool "Microsoft Visual C++ Compiler": cl
Unable to locate build tool "Microsoft Visual C++ Linker": link
This is especially weird since through a development command window I can call
nmake -f model.mk all
which happily compiles to a .exe
Which is what is in the .bat file that causes the original nmake error.
  1 件のコメント
Michael Krastev
Michael Krastev 2017 年 11 月 14 日
Ok I found the problem.
Calling VCVARSALL.BAT (which the auto generated bat file does before calling nmake to launch development prompt) changes the current working directory as of VS2017.
To Fix the bat script needs
https://developercommunity.visualstudio.com/content/problem/26780/vsdevcmdbat-changes-the-current-working-directory.html
to predefine the working directory. This should be in the model.bat file that gets generated when building but it isn't.

サインインしてコメントする。

採用された回答

Nick Choi
Nick Choi 2017 年 11 月 16 日
This issue seems like it may be related to the following external bug report:
If this is the case, the report provides a workaround for the issue and the bug was fixed as of MATLAB R2017b Update 1.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBuild MATLAB Interface to C++ Library についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by