Compiling for 10.6 on 10.8 (C+11 woes)


#1

Hello all, I’m building a plugin AU synthesiser on Mountain Lion, and I’ve been using new C+11 features pretty liberally, with Xcode set to use the (LLVM) libc++ standard library implementation.

I was trying to compile the plugin for a friend to use on his 10.6 machine, but I’ve been having trouble compiling with that OS as my target. After some reading I discovered that libc++ isn’t available on Snow Leopard, and Apple has consequently blocked targeting that platform while using that library for std. My project won’t compile using GNU libstdc++ because of some of the fancy C++11 features I’ve been using. Thing is, I like them and I’d rather not rewrite the code to get rid of them (I know, I should have checked this stuff out before beginning, but I’m inexperienced, consider it a lesson learned).

I read that it should be possible to compile with libc++ as a statically linked library so the code will run on 10.6, but I’ve no idea how to do that (again, I’m a bit of a noob). My Google searches are not producing much useful info. Has anyone here done this? Or any other advice on how to proceed?


#2

A bump for this. I have now downloaded and built libc++ for 10.6 following the instructions here. I have set my deployment target to 10.6. But clang is throwing the error:

I have read a few disturbing reports that compiling for 10.6 from 10.8 in this way is effectively impossible without building clang from source. Why would Apple do that? Does anyone have any info on this issue?