问题描述
我一直在尝试使用C ++ 11。我开发一个Android项目,我想使用std ::互斥。随着OpenCV的但无论我做什么,我只是不能似乎解决了键入互斥无法解析
错误。
I have been trying to use C++11. I am developing an android project and i want to use std::mutex. Along with OpenCVBut no matter what I do, I just cant seem to fix the Type 'mutex' could not be resolved
error.
我已经试过下面我发现SO等地的教程。 LINK1 LINK2 LINK3 LINK4
I have tried following the tutorials i found on SO and other places.LINK1 LINK2 LINK3LINK4
- ADT v22.3.0-887826
- 在安装的C / C ++编译器(CDT)
随着这么多的教程,它已经成为一个真正的混乱了。因此,我将解释我的当前设置
Following so many tutorials, it has become a real mess now. So I will explain my current settings
- 项目>属性> C / C ++编译>工具链编辑器
- 在当前工具链是跨海湾合作委员会
- 在当前Builder是机器人生成器
- Project > Properties > C/C++ Build > Tool Chain Editor
- Current Tool Chain is "Cross GCC"
- Current Builder is "Android Builder"
项目>属性> C / C ++编译>搜索选项
Project > Properties > C/C++ Build > Discovery Options
- 在编译器调用命令是海湾合作委员会
- Compilter调用argments是-E -P -v -dD$ {plugin_state_location} /specs.c -std = C + + 11
项目> C / C ++常规>路径和符号>#符号标签
Project > C/C++ General > Paths and Symbols > # Symbols tab
- 符号= __cplusplus和值= 1
在我Application.mk文件我有以下
In my Application.mk file I have the following
APP_STL := gnustl_static APP_USE_CPP0X := true APP_CPPFLAGS := -std=c++11 -frtti -fexceptions APP_ABI := armeabi-v7a APP_PLATFORM := android-8
我试图改变在 CPLUSPLUS符号的价值201103L并试图__GXX_EXPERIMENTAL_CXX0X 带一个空值
I tried to change the cplusplus symbol's value to 201103Land tried __GXX_EXPERIMENTAL_CXX0X with an empty value
但似乎没有任何工作,我在做什么错了?
But nothing seems to work, What am I doing wrong??
任何帮助是AP preciated!
Any help is appreciated!
推荐答案
支持
的std ::线程
是一个有点特殊。的问题得到解决,例如,在本文通过并拢。这篇文章是非常短的,但它可以用一句话概括:Support for
std::thread
is a bit special. The issue is addressed, for example, in this article by Binglong. The article is really short, but it can be summarized in one sentence:您无法使用(默认),GCC 4.6工具链,如果你想
的#include<螺纹>
或的#include<互斥>
。那么,请加入
NDK_TOOLCHAIN_VERSION = 4.8
或NDK_TOOLCHAIN_VERSION =铛
您应用程序。 MK
。有关ADT重建其的首页的正确,看的 Android NDK构建,方法无法得到解决 或 Eclipse编译成功,但仍给语义错误 的。
For ADT to rebuild its Index correctly, see Android NDK build, Method could not be resolved or Eclipse compiles successfully but still gives semantic errors.
这篇关于建立C ++ 11(的std ::线程)的NDK与ADT / Eclipse中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!