Can not find the compiler when using simulink

8 次查看(过去 30 天)
Hi, I am using matlab2012b. I want to take the simulink xPC Target demo"xpccanpci" for a test, but when I build the model, the simulink will report an error as "An installed compiler was not detected. Certain simulation modes, as well as host-based coder builds require that a compiler be installed." but I think I have installed the compiler, when I type in the "mex -setup" in the command window for matlab, it will give a choice for compiler, and my installed compiler can be listed as: Select a compiler: [1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2012b\sys\lcc [2] Microsoft Visual C++ 2010 in C:\Program Files\Microsoft Visual Studio 10.0 [3] Microsoft Visual C++ 2008 SP1 in C:\Program Files\Microsoft Visual Studio 9.0
[0] None
and I also restarted my matlab after choosing a compiler. I have tried the three compilers, but no use.
May I get some help about this problem? Thank you.

采纳的回答

hong feng
hong feng 2012-12-28
I am so sorry for my stupid question, i just thouhgt that xpc use the same compiler as mex-setup. but xpc need another compiler setting using command"xpcsetCC'setup'", wishing useful for other new users on 2012b
  2 个评论
Gijs van Oort
Gijs van Oort 2013-3-1
Thank you so much for sharing your own answer!
It took me two complete days of in/un/rein-stalling tens of different versions of DotNet, SDK and Visual Studio in even more different orders before stumbling upon this thread, and with one simple command in Matlab everything has been fixed.
Mathworks, please include a line in http://www.mathworks.nl/support/compilers/R2012b/win64.html saying that using mex -setup is NOT enough; that would have saved me (and I guess many others) hours of work!
Chethan Pandarinath
Also wanted to say thank you for sharing this answer, I was stuck on this "stupid question" for quite a while.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by