Making mex work with R2014a and MacOS 10.9.2

조회 수: 1 (최근 30일)
s
s 2014년 4월 11일
댓글: Royi Avital 2015년 6월 23일
I am trying to compile playrec in matlab using mex, so a c++ compiler is needed. I am using OS X 10.9.2, matlab R2014a, and XCode 5.1 .
This is the errors I get:
Error using mex
clang: warning: no such sysroot directory:
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -std=c99'
In file included from /Users/LordTengil/Downloads/PlayrecForMatlab-playrec-48b4f6a/src/mex_dll_core.c:88:
In file included from /Applications/MATLAB_R2014a.app/extern/include/mex.h:57:
/Applications/MATLAB_R2014a.app/extern/include/matrix.h:23:10: fatal error: 'stdlib.h' file not found
#include <stdlib.h>
^
1 error generated.
The first warning I do not understand: I can find MacOSX10.8.sdk in exactly that directory. I am guessing the error of not finding stdlib.h is because of that first warning.
  댓글 수: 2
Miikka Tikander
Miikka Tikander 2015년 5월 24일
편집: Walter Roberson 2015년 5월 24일
I get the same error. My setup is OS X 10.10.3, Matlab 2015a, and Xcode 6.3.2. Any suggestions for a fix? There are some fixes modifying the mexoptions.sh -file but that's no longer used in 2015a.
Here's my error message for reference..
Error using mex
clang: warning: no such sysroot directory:
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
-std=c99'
In file included from /Users/miikka/Documents/Matlab/playrec/m_files/../src/mex_dll_core.c:88:
In file included from /Applications/MATLAB_R2015a.app/extern/include/mex.h:51:
/Applications/MATLAB_R2015a.app/extern/include/matrix.h:23:10: fatal error: 'stdlib.h' file not
found
#include <stdlib.h>
^
1 error generated.
Error in build_mex (line 131)
failed = mex(build_args{:});
Error in compile_playrec_func (line 262)
failed =
build_mex('playrec',all_files,all_include_dirs,compiler_flags,all_link_libs,lib_dirs,extra_flags,debug,verbose);
Error in compile_playrec_gui>compile_button_Callback (line 323)
if compile_playrec_func (get(handles.debug_checkbox,'Value'), ... % debug
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in compile_playrec_gui (line 55)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating UIControl Callback
Royi Avital
Royi Avital 2015년 6월 23일
@Miikka, have you found a solution?

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

답변 (2개)

Miikka Tikander
Miikka Tikander 2015년 5월 24일
I managed to get mine working with this tip: www.mathworks.com/matlabcentral/answ...
Hope it helps!
-miikka

Walter Roberson
Walter Roberson 2015년 5월 24일
The -std=c99 has been added in as part of the directory name. Notice the closing quote is not until after the -std=c99 . Somewhere in one of the configuration steps, the directory is being configured incorrectly.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by