Okay I could solve the problem! Let me explain it in the following lines:
- Find location of Matlab App
- Access contents of package
- Locate the mbuildopts.sh inside bin folder
- Open with text editor
- Identify tags that target the compiler (CC:) as gcc-4.0 and change it to just gcc
- Identify tags that target the SDK and the version of it
- Get the absolute path to target of XCode's SDK and change it for the older one (there are two places to do this) also be sure to change the version of the target (in my case to 10.8)
- Some of the code is around line 200 and should look like this after changed :
CC='gcc'
SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
MACOSX_DEPLOYMENT_TARGET='10.8'
- Now save changes on the .sh file
You have successfully changed the targeted SDK! and now can call the command gcc (not more gcc-4.0 any more) without targeting any older version of XCode Command Line Tools that is hard to find and long to download. I hope this might be helpul for future Mac users and for those who get similar errors on the mbuild command.
Thanks for the help and enjoy!