Android Cmake Error: os_defines.h:39:22: fatal error: features.h: No such file or directory compilation terminated
<p>How can I tell cmake to point to the Android compiler in the NDK?</p>

<p>Below is my CMAKE file:</p>

<pre><code>cmake_minimum_required(VERSION 3.7)

set(CMAKE_SYSTEM_NAME Android)

set(CMAKE_ANDROID_NDK /home/c/Android/Sdk/ndk-bundle)

set(ANDROID_NDK  /home/c/Android/Sdk/ndk-bundle)
set(CMAKE_ANDROID_API 21)


SET(CMAKE_SYSROOT /home/c/Android/Sdk/ndk-bundle/)


# build native_app_glue as a static lib
add_library(app-glue STATIC
            ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)

# now build app's shared lib
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 ")

add_library(native-activity SHARED
            main.cpp)

target_include_directories(native-activity PRIVATE
                           ${ANDROID_NDK}/sources/android/native_app_glue)

# add lib dependencies
target_link_libraries(native-activity
                      android
                      app-glue
                      EGL
                      GLESv1_CM
                      log)
</code></pre>

<p>I get the following error:</p>

<blockquote>
  <p>In file included from
  /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h:482:0,
                   from /usr/include/c++/5/initializer_list:41,
                   from /home/c/AndroidStudioProjects/NativeActivity4/app/src/main/cpp/main.cpp:19:
  /usr/include/x86_64-linux-gnu/c++/5/bits/os_defines.h:39:22: fatal
  error: features.h: No such file or directory compilation terminated.</p>
</blockquote>

<p>It is using my standard linux compiler. How can I tell cmake to point to the Android compiler in the NDK? I do not think a standalone toolchain in necessary for this but that variable is available. I am doing his in netbeans if that matters.</p>