Simulink Compiler Errors and Compiler Selection

6 次查看(过去 30 天)
Hi,
I'm trying to compile and run Simulink models on a 32-bit Windows machine which I already know run just fine on a 64-bit Linux machine. The models won't compile, however, giving me exceptionally helpful errors like "Error(s) encountered while building model". When I turn on the verbose accelerator builds, I get a little bit more detail in the command window, with error messages like "ACFT_ENV_Atm_mdllib.lib : fatal error LNK1127: library is corrupt". (ACFT_ENV_Atm being the name of a model file). Anyone ever seen anything like this before?
I'm not sure if this is a related problem or not, but it looks to me like when Simulink is compiling, it's using the LCC default compiler even though I have a different C compiler selected under "mex -setup". At first I was trying to use Visual Studio 2005, but since that isn't on the official list of supported compilers anymore, I went out and got the latest Windows SDK 7.1. When I select either of these under "mex -setup", however, the verbose accelerator build still spits out a lot of lines like "C:/PROGRA~1/MATLAB/R2013a\sys\lcc\bin\lcc" and none at all referencing the location of the compiler, so I have to assume that it's not obeying the selection that I made under "mex -setup". Is there a different place to set compiler options for Simulink? I always thought that Simulink still used the "mex -setup" options, and I could swear that I successfully used that before in R2012a or R2012b. (The Microsoft compilers made my models run much faster than LCC).
- Greg
  3 个评论
Greg
Greg 2013-4-26
Strangely, the problem seems to have gone away when I restarted my computer. (Not sure if I had attempted to restart just MATLAB before I restarted the computer).
Severin
Severin 2017-7-13
编辑:Severin 2017-7-13
Same problem here. Simulink seems to not obey mex -setup. Restarting MATLAB and computer did not solve my problem. I'm running MATLAB R2008a (7.6.0) with Microsoft Visual C++ 2008 as the compiler. I can compile .c file using mex file.c. Compiling a fresh Simulink model with a single Embedded MATLAB Function results in the error:
"%ProgramsDir%\matlab\r2008a\sys\lcc\bin\lccmake" -f untitled_sfun.lmk
The system cannot find the path specified.
Running mex.getCompilerConfigurations('c') outputs:
mex.compilerConfiguration
package: mex
properties:
Name: 'Microsoft Visual C++ 2008'
Manufacturer: 'Microsoft'
Language: 'C++'
Version: '9.0'
Location: 'D:\Program Files (x86)\Microsoft Visual Studio 9.0'
Details: [1x1 mex.compilerConfigurationDetails]
list of methods
How can I fix this issue?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Compiler 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by