How to compile c++11 code with android ndk and eclipse?

前端 未结 2 1136
孤独总比滥情好
孤独总比滥情好 2020-12-29 08:14

I\'m using android NDK r8d, and eclipse Juno. I\'m trying to compile C++ code which uses C++11 stuff like mutex, lock_guard, shared_ptr

2条回答
  •  暖寄归人
    2020-12-29 08:59

    Regarding your first question:

    1. Go to Project > Properties > C/C++ General / Paths and Symbols

    2. In the "Includes" tab, add the proper directory, e.g. /android-ndk-r8d/sources/cxx-stl/gnu-libstdc++/4.7/include

    Regarding your second question, I'm also looking for an answer. It is absolutely not clear how to define the GXX_EXPERIMENTAL_CXX0X macro in Eclipse.

    Some say that it should be "added as a predefined macro to the indexer", but it looks like we both could not find a way to implement that...

    I have read elsewhere that it should be added to "C/C++ General / Paths and Symbols / Symbols / GNU C++" but I can't find the "Symbols / GNU C++" part in my version of Indigo.

提交回复
热议问题