c++ - 在 iOS 目标低于 5.0 的 iPhone 应用程序中使用 C++

标签 c++ ios compiler-errors

我的 iPhone 应用程序中有一个名为 Database.hppC++ 头文件

但是当我将 Xcode 上的 iOS 目标设置为 4.3 时,我收到此编译错误:

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

是否有解决方法可以使其适用于低于 5.0 的 iOS?

最佳答案

libc++ 是 Apple 的新 C++ 标准库实现。如果您需要在旧操作系统版本上运行,则需要使用旧的 GNU libstdc++ 库。在项目设置中,将“C++ 标准库”设置更改为“GNU C++ (libstdc++)”。

关于c++ - 在 iOS 目标低于 5.0 的 iPhone 应用程序中使用 C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18378812/

相关文章:

C++ 数组初始值设定项。使用枚举类型

ios - 从另一个类调用getter方法

Java Generic 不推断类型

c++ - 指向抽象模板基类的指针?

c++ - 是否可以在 C++ 中覆盖此虚拟方法?

ios - 如何使用 previousServerchangetoken 初始化 CKFetchRecordZoneChangesOperation?

javascript - 如何在 Laravel 项目中为 VueJS 3 设置 compilerOptions.isCustomElement

variables - 运行计时器时出错 : (void-variable message) in Emacs init. el

c++ - C#define 嵌套在 #ifdef 中

android - Kotlin 多平台用于开发 Mobile SDK?