Problem with Mex in Matlab R2012a - Mac OS X 10.8

When I try to mex a file I get the following error. My Mac does have gcc and g++ compilers installed, yet I get these errors.
/Applications/MATLAB_R2012a.app/bin/mex: line 305: gcc-4.2: command not found
/Applications/MATLAB_R2012a.app/bin/mex: line 1326: g++-4.2: command not found
mex: compile of ' "features_hog.cc"' failed.
Error using mex (line 206)
Unable to complete successfully.*_**
I have copy pasted the following lines from Terminal. These indicate the version of gcc and g++.
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Pls help !!
Thanks !

 채택된 답변

Ken Atwell
Ken Atwell 2012년 9월 14일

1 개 추천

There is a patch available for newer versions of Xcode:

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 9월 14일

0 개 추천

Create a link from the existing file name g++ to g++-4.2

카테고리

도움말 센터File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by