LiangWang
LiangWang

Reputation: 8836

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

I'm using zipArchive library in Xcode to integrate into my project to do unzip operation. And I got following compile error message. my question is how can i resolve this compile issue?

What steps will reproduce the problem?

  1. download ziparchive from http://code.google.com/p/ziparchive/:
  2. create a new xcode project (just use single view template), select ios4.3 simulator
  3. drag the download unzipped folder to project, and select "copy item..." ,"create group", and check the "add to targets"

What is the expected output? What do you see instead?

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

What version of the product are you using? On what operating system?

mac, xcode4.5.1, iphone4.3 simulator (it's OK in iOS6)

Upvotes: 1

Views: 1279

Answers (1)

Martin R
Martin R

Reputation: 539765

The file ZipArchive.mm from the ziparchive project has the suffix .mm for Objective-C++ files. However, the file does not seem to contain any C++ code. After renaming it to ZipArchive.m I could compile it even for iOS 4.3 deployment target.


A different solution of the problem can be found in the Xcode 4.5 Release Notes:

Projects created using this Xcode release use the new libc++ implementation of the standard C++ library. The libc++ library is available only on iOS 5.0 and later and OS X 10.7 and later.

To enable deployment on earlier releases of iOS and OS X in your project, set the C++ Standard Library build setting to libstdc++ (Gnu C++ standard library).

Upvotes: 2

Related Questions