title: Eclipse-CDT fails to find stdlib symbols in NDK project
body: <p>I am trying to write a simple Android application using the NDK and C++. Specifically, I'd like to use the gnustdc++ included with the newest version of the NDK (r7). The JNI library has compiled and worked perfectly fine as C, but now that I'm trying to introduce C++, I've run into some issues.</p>
  
  <p>I have added <code>${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/include/</code> to my project's include paths, and the <code>#includes</code> inline are resolved. However, attempting to actually use any STL class (such as <code>vector</code>) results in <code>Symbol 'vector' could not be resolved</code>.</p>
  
  <p>All of the standard C symbols imported from <code>&lt;stdlib.h&gt;</code> and such work as well, until I try to replace the <code>#include</code> with <code>&lt;cstdlib&gt;</code>. Then it fails with <code>Function 'malloc' could not be resolved</code> and so forth.  </p>
  
  <p>Oddly enough, adding the stlport headers (in <code>${NDK_ROOT}/sources/cxx-stl/stlport/stlport</code>) fixes all of my issues. However I am linking in GNU C++, not STLPort, so this is an inconvenient and improper "solution" at best. It seems odd that these headers would work but the others would not. Is Eclipse failing to index or resolve the GNU C++ headers?</p>
  
  <h3>Android.mk</h3>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE := libfoobar-jni
  LOCAL_SRC_FILES := foobar.cpp
  LOCAL_LDLIBS := -llog -lGLESv2
  
  LOCAL_C_INCLUDES := sources/cxx-stl/gnu-libstdc++/include/
  LOCAL_CFLAGS := -g -std=c99
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <h3>Application.mk</h3>
  
  <pre><code>APP_STL := gnustl_shared
  </code></pre>
  
  <p>Edit: I set up my project based on: </p>
  
  <p><a href="http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/" rel="nofollow">http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/</a></p>