Code Guru
Code Guru

Reputation: 393

Using C++ in iPhone app with iOS target below 5.0

I have a C++ headerfile called Database.hpp in my iPhone app.

But when I put the iOS Target on Xcode to 4.3 I get this compilation error:

clang: error: invalid deployment target for -stdlib=libc++ 
(requires iOS 5.0 or later)

Is there a workaround to make it work for iOS lower than 5.0?

Upvotes: 2

Views: 112

Answers (1)

Greg Parker
Greg Parker

Reputation: 8012

libc++ is Apple's new C++ standard library implementation. If you need to run on old OS versions, you need to use the old GNU libstdc++ library instead. In your project settings, change the "C++ Standard Library" setting to "GNU C++ (libstdc++)".

Upvotes: 2

Related Questions