emlc error in converting M-code to C-code

조회 수: 3 (최근 30일)
Arza
Arza 2011년 2월 8일
Hi,
I am going to convert an M-code to C-code.
I started with the Simulink Real-Time Workshop demo i.e.:
Demos>Simulink > Real-Time Workshop > Application Samples > Embeddable C-Code Generation Using Embedded MATLAB Coder
For compiling the M-File into an executable file I tried exactly what the demo says, i.e.:
emlc -T rtw:exe -o rtwdemo_emlcsobel rtwdemo_emlcmain.m stdio.h
It should be mentioned that the file main.c was generated, however I got this error:
??? Unknown compiler
Error in ==> main Line: 1 Column: 1
Compilation failed: Open error report.
??? Error using ==> emlc
It seems that the compiled algorithm is not generated. I have the license for real-time_workshop.
Any idea?
Many thanks
Arza

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 2월 9일
You need to get one of the supported compilers and then run mex -setup: http://www.mathworks.com/support/compilers/release2008a/

추가 답변 (2개)

Walter Roberson
Walter Roberson 2011년 2월 8일
Which C compiler do you have installed and configured for this use, and which Matlab version are you using?

Arza
Arza 2011년 2월 9일
I am using Matlab R2008a (Ver. 7.6.0.324) and I have Microsoft Visual C++ 2010 Express (Ver. 10.0.30319) installed.
I tried to set up the C compiler by running:
mex –setup
However, after letting mex to locate installed compilers, it shows None. (It does not show the installed visual C++)
  댓글 수: 1
James Tursa
James Tursa 2011년 2월 9일
You need to have appropriate mexopts files for each compiler so that mex -setup knows about it. e.g., for MSVC 2010 Express you would need msvc100freeopts.bat and msvc100freeopts.stp in the [matlabroot '\bin\win32\mexopts'] directory

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by