mex C compiler cannot find .c file

조회 수: 2 (최근 30일)
Kelsie Zhao
Kelsie Zhao 2015년 5월 6일
댓글: James Tursa 2015년 5월 6일
I am using 64bit matlab 2013a, have installed windows SDK 7.1 and used mex -setup to locate that c compiler.
However, when I tried to use it by compiling the example .c file,
cd([matlabroot '\extern\examples\mex'])
mex yprime.c
it prompts me, ...\BIN\MEX.PL: Error: 'yprime.c' not found .
But the file is just inside the directory.
I doubt it is the C compiler problem so I uninstalled and installed it again but the program retains.
Another confusing part is that, when I did "mex -setup", the located Microsoft SDK 7.1 is in " C:\Program Files (x86)\Microsoft Visual Studio 10.0", which seems to suggest it is in 32bit directory.
But I download SDK 7.1 installer from the website suggested for Windows 64bit..
I am completely confused. Any suggestion is gratefully welcomed!

답변 (1개)

James Tursa
James Tursa 2015년 5월 6일
What do you get whey you type:
dir yprime.c
Also, as a general rule you should copy source files from their original directories into your working directory and compile them there, rather than compiling them in the source directory.
  댓글 수: 2
Kelsie Zhao
Kelsie Zhao 2015년 5월 6일
Hi Thanks for the suggestions. Before I saw your response I reinstalled Matlab, so right now it is giving me a different error. When I type
mex yprime.c
it gives me
Building with 'Microsoft Windows SDK 7.1 (C)'.
Error using mex_
Creating library yprime.lib and object yprime.exp
I then re-installed Matlab 32 bit, it gives a similar error.
Do you have any idea what this is?
James Tursa
James Tursa 2015년 5월 6일
Do you have "write" privilege in the directory you are using? The error message looks like it can't create the files.

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

카테고리

Help CenterFile Exchange에서 Troubleshooting in MATLAB Compiler SDK에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by