2012年8月1日 星期三

Compiling mex on MAC OS X

I have tried to compile mex for my matlab program, but it alway shows the error message like 'can't find std...'

Matlab version : R2011b
OS : OS X Lion 10.7

To solve this you have to install Xcode first, it can be downloaded form mac app store (free).
Second, edit the mexopt.sh,then find SDKROOT
 vi ~/.matlab/R2011b/mexopt.sh
set SDKROOT to

SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk'

according to your OS version

Ref: http://stackoverflow.com/questions/9845762/matlab-mex-cant-find-standard-library-with-xcode-4-3-mac