How can I compile GCC on a mac so compiled executables will work on earlier versions of OS X?
I'm attempting to build a program (Dwarf Fortress) that uses C++0x features that aren't well supported in the latest Leopard version of XCode. As there is also a significant speed boost from using GCC 4.5, we've decided to build ou开发者_JAVA百科r own.
However, this causes the resulting executables to not work on Tiger, citing missing symbols in libc. Presumably, GCC is being built against the Leopard SDK, not the installed Tiger SDK, which is reasonable but annoying. How would I make it build against Tiger's?
You need to pass -mmacosx-version-min=10.5 to ld, which will tell it to link against the appropriate symbols in libc.
精彩评论