开发者

How can I compile GCC on a mac so compiled executables will work on earlier versions of OS X?

开发者 https://www.devze.com 2023-01-17 10:16 出处:网络
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 G

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消