Compiler error

Hey,
I have this error on my pc when I try to work with a "Embedded Matlab function block"
"Unable to locate 'mexopts.bat', and therefore cannot determine which compiler to use for simulation builds. Use 'mex -setup' to select a supported compiler."
I am using Matlab verR2010a win 64 bit.Do let me know if additional information is required.
Kamran Qureshi

답변 (4개)

Walter Roberson
Walter Roberson 2011년 4월 9일

0 개 추천

At the command line, have you typed
mex -setup
??
Which compiler do you have installed? There are only a few supported compilers for that version.

댓글 수: 1

Kamran
Kamran 2011년 4월 18일
Sorry for very late reply
Select a compiler:
[1] Microsoft Visual C++ 2008 Express in D:\VC
[0] None
these are the compilers available and on trying to install the first one I get an error
*****************************************************************************
Error: Could not find the 64-bit compiler. This may indicate that the
"X64 Compilers and Tools" or the Microsoft Windows Software
Development Kit (SDK) is not installed. To build 64-bit binaries,
Microsoft Visual C++ 2008 Express Edition requires that these two
packages be properly installed.
*****************************************************************************
Trying to update options file: C:\Users\Kamran\AppData\Roaming\MathWorks\MATLAB\R2010a\compopts.bat
From template: D:\INSTAL~1\MATLAB~1\bin\win64\mbuildopts\msvc90freecompp.bat
Done . . .
Kamran

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

Chirag Gupta
Chirag Gupta 2011년 4월 18일

0 개 추천

Hi Kamran,
On 64 bit systems, you need a 64 bit compiler. By default, MSVC does not install the 64 bit Compiler tools as indicated by the error message.

댓글 수: 7

Kamran
Kamran 2011년 4월 18일
The above thread helped in resolving mexopt.bat error.
Thanx to Chirag Gupta.
Now there is a make error. Any one know what this is all about.
Kamran
Walter Roberson
Walter Roberson 2011년 4월 18일
Please post more information about the make error.
Kamran
Kamran 2011년 4월 20일
Well its a little long ill try to make it readable though
"Making simulation target "untitled_sfun", ...
C:\Users\Kamran\Documents\MATLAB\slprj\_sfprj\untitled\_self\sfun\src>call "mexopts.bat"
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
### Compiling "untitled_sfun.c"
cl.exe /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE/D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /MD /I "d:\installed software\matlab\extern\include" /I "d:\installed software\matlab\simulink\include" /I
"d:\installed software\matlab\stateflow\c\mex\include" /I
"d:\installed software\matlab\stateflow\c\debugger\include"
"untitled_sfun.c"
untitled_sfun.c
d:\installed software\matlab\extern\include\tmwtypes.h(43) :
fatal error C1083: Cannot open include file: 'limits.h': No such
file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl.exe"' : return code '0x2'
Stop."
Hope its what you wanted.
Kamran
Arnaud Miege
Arnaud Miege 2011년 4월 20일
What code are you using in your Embedded MATLAB Function block?
Kaustubha Govind
Kaustubha Govind 2011년 4월 20일
Do you see limits.h present in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\? If not, your MSVC installation might be corrupt.
Kamran
Kamran 2011년 4월 21일
well I re-installed my Visual C as well but still the same error.Also the only thing is its not registered, I dont think it should prevent it from using the compiler.
Kamran
Kamran
Kamran 2011년 4월 21일
One other thing I'd like to mention, I dont see include folder in VC 10. IS the path provided correct ?
Kamran

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

Kamran
Kamran 2011년 4월 20일

0 개 추천

I am just inverting my input,
y = 1-u;
Also can any one clerify, if this is a Matlab error or the code error.
Kamran
Kamran
Kamran 2011년 4월 21일

0 개 추천

I copied and pasted this piece of code from the thread Chirag Gupta posted earlier
For example, to select the compiler and build the YPRIME.C example MEX-file,
mex -setup % Select Visual Studio 2008 Express Edition
copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
mex -v yprime.c
yprime(1,1:4)
The final line should execute the MEX-file, and calculate the following output:
ans =
2.0000 8.9685 4.0000 -1.0947
The make error was eliminated :)

댓글 수: 1

Kaustubha Govind
Kaustubha Govind 2011년 4월 22일
Do you mean the issue is resolved with the Embedded MATLAB Function as well?

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

카테고리

도움말 센터File Exchange에서 Troubleshooting in MATLAB Compiler SDK에 대해 자세히 알아보기

질문:

2011년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by