Clang build with C ++ 11 with OSX 10.5 support

I have a small C ++ project that builds for Windows 2000 and higher and OSX 10.5 and higher. Now I wanted to introduce the C ++ 11 header file <codecvt>to do some conversion between std :: wstring and std :: string, plus I also wanted to use std :: unique_ptr.

Everything was built perfectly in windows with Visual Studio 2012. In OSX 10.8 with Clang 4.2, on the other hand, it was not built, it could not find the C ++ header file. I quickly found that I needed to add the compiler flags "-std = C ++ 11 -stdlib = lib ++", but since I use "-mmacosx-version-min = 10.5" for the target OSX 10.5, I getting an error

clang: error: invalid deployment target for -stdlib = libC ++ (requires OS X 10.7 or later)

So my question is:
Can't I use the features of C ++ 11 and target on OSX 10.5?

+4
source share

All Articles