필터 지우기
필터 지우기

Simulink Compiler Errors and Compiler Selection

조회 수: 8 (최근 30일)
Greg
Greg 2013년 4월 22일
편집: Severin 2017년 7월 13일
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