MATLAB: Do I receive an error when I try to compile a MEX-file on OS X 10.5 (Leopard)

gcclinkMATLABosx

I upgraded from OS X 10.4 to 10.5 and when I try to compile a C MEX function I receive the following error:
/usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libm.dylib
unknown flags (type) of section 6 (__TEXT,__literal16) in load command 0
/usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/libstdc++.dylib
load command 8 unknown cmd field
/usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../
libSystem.dylib unknown flags (type) of section 6 (__TEXT,__literal16)
in load command 0
/usr/bin/ld: /usr/lib/libSystem.B.dylib unknown flags (type) of
section 6 (__TEXT,__literal16) in load command 0
/usr/bin/ld: /usr/lib/libstdc++.6.dylib load command 8 unknown cmd field
/usr/bin/ld: /usr/lib/libgcc_s.1.dylib load command 8 unknown cmd field
collect2: ld returned 1 exit status

Best Answer

This issue is caused by the version of the compiler you are using. If you had XCode installed on OS X 10.4, then the upgrade process to 10.5 will not install the updated version of XCode (and other development tools). Please uninstall the older version of XCode and install the updated development tools that are available on the OS X 10.5 DVD.