title: Cocos2d-x extensions in an Android app
body: <p>I'm having trouble using <code>CCHttpRequest</code> in an Android app that's part of a Cocos2d-x project. Specifically I get a bunch of build errors when building in Eclipse that I don't get when building the iOS app in Xcode.</p>
  
  <p>An example build error that I receive in Eclipse (but not in Xcode) is:</p>
  
  <pre><code>`Type 'CCHttpResponse' could not be resolved`
  </code></pre>
  
  <p>This error is for the line:</p>
  
  <pre><code>CCHttpResponse *response = (CCHttpResponse *)data;
  </code></pre>
  
  <p>Both Eclipse and Xcode projects reference the same <code>.cpp</code> files. To make the Eclipse project aware of the Cocos2d-x extensions I did the following:</p>
  
  <ol>
  <li>Open Project => Properties => C/C++ General => Paths and Symbols => Source Location</li>
  <li>Click <code>Link Folder...</code></li>
  <li>Check <code>Link to folder in the file system</code></li>
  <li>Browse to the folder containing the extensions (that work in the Xcode project)</li>
  <li>Click Ok, Apply, and Ok</li>
  </ol>
  
  <p>Note there are some other surprising errors in my <code>HelloWorldScene.cpp</code> file. For example:</p>
  
  <p><code>Symbol 'vector' could not be resolved</code>. </p>
  
  <p>I'm guessing the problem is related to how I've set-up something in Eclipse. Since I'm new to Eclipse I'm not sure what to try. Everything builds and runs fine in the Xcode project.</p>
  
  <p><strong>Edit #1</strong>: After commenting the code responsible for most of the Eclipse build errors I noticed the error:</p>
  
  <pre><code>`make: *** [obj/local/armeabi/libgame.so] Error 1`
  </code></pre>
  
  <p>I don't know what this means but it seems like it might be a more fundamental error than unresolved symbols.</p>
  
  <p><strong>Android.mk</strong>:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE := game_shared
  
  LOCAL_MODULE_FILENAME := libgame
  
  LOCAL_SRC_FILES := hellocpp/main.cpp \
                     ../../Classes/AppDelegate.cpp \
                     ../../Classes/HelloWorldScene.cpp \
                     ../../Classes/StringHelper.cpp
  
  LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes                   
  
  LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static
  
  include $(BUILD_SHARED_LIBRARY)
  
  $(call import-module,CocosDenshion/android) \
  $(call import-module,cocos2dx) \
  $(call import-module,extensions)
  </code></pre>
  
  <p><strong>Application.mk</strong></p>
  
  <pre><code>APP_STL := gnustl_static
  APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1
  </code></pre>