如何为Android编译C ++ 14代码? [英] How to Compile C++14 code for Android?

查看:210
本文介绍了如何为Android编译C ++ 14代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用ndk10d编译Android的C ++ 14源代码?我已经尝试过g ++和clang编译器,但是-std=c++14 -std=c++1y标志似乎不起作用.

Is it possible to compile C++14 source code for Android with ndk10d? I've tried both g++ and clang compilers but it seems that -std=c++14 -std=c++1y flags do not work.

如果我将c++_static用作APP_STL,则会出现以下错误:

If I use c++_static as my APP_STL, i get the following error:

User/someone/Software/Android/android-ndk-r10d/platforms/android-17/arch-arm/usr/include/locale.h:55:1: error: empty struct has size 0 in C, size 1 in C++

User/someone/Software/Android/android-ndk-r10d/platforms/android-17/arch-arm/usr/include/locale.h:55:1: error: empty struct has size 0 in C, size 1 in C++

编辑:我使用的是Mac OSX 10.10.4和Xcode 6.3.2(能够为iOS编译C ++ 14).

I am using Mac OSX 10.10.4 with Xcode 6.3.2 (able to compile C++14 for iOS).

推荐答案

我使用 android-ndk-r12b-windows-x86_64 ,使用 -std = c ++ 14

Android.mk

Android.mk

LOCAL_CPPFLAGS  = -Wall -std=c++14

这篇关于如何为Android编译C ++ 14代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆