目前我正在为Simulink Real-Time构建模型,并将Microsoft Visual C ++编译器社区2015作为我的Simulink Real-Time编译器。当我尝试构建我的模型时,它会出现以下错误:
### Linking ...
link.exe /nologo /dll /MANIFEST /OPT:NOREF /export:mexFunction /OUT:Test_Handler_sfun.mexw64 /map:"Test_Handler_sfun.map" @Test_Handler_sfun.mol
LINK : fatal error LNK1104: cannot open file 'ucrt.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Bin\amd64\link.exe"' : return code '0x450'
Stop.
以前我也有这个错误,这是由我认为的同样问题引起的。我以一种非常不雅的方式解决了这个问题。
C1083: Cannot open include file: 'stddef.h': No such file or directory
我在google上搜索了很多。我发现这是因为某些文件和/或库现在位于Windows 10 SDK安装文件夹(C:\ Program Files(x86)\ Windows Kits \ 10)中,并且此路径未包含在编译器中。您在Visual Studio项目中工作时有很多解决方案,但在使用Matlab和/或Simulink时却没有。
如何确保编译器可以找到并打开库和文件?
答案 0 :(得分:0)
由于您以“不雅”的方式解决了丢失的头文件,因此我建议您解决当前问题的另一种不合理的解决方案。我遇到了同样的问题,并在编译选项中添加了相应的库路径(-L...
帮助:
mex -output mybinary
-I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"
-L"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64"
请务必将其调整为Windows套件的确切版本(在我的情况下为10.0.10240.0
),并定位(x64
)。
答案 1 :(得分:0)