Search code examples
androidc++g++android-source

how to specify the use of g++ in Android.mk?


I have a c++ library that i've added to the android2.3.6 source code and i want to compile it and link using g++ instead of gcc and ld. is it possible? Also,i've added this line into my Android.mk file:

  LOCAL_CXX=path/to/g++compiler

But the building still use gcc.

is there any solution?

Thanks in advance!

EDIT:

Full Android.mk

LOCAL_PATH := $(call my-dir) 
libdash_src_files :=cppfiles 
LOCAL_C_INCLUDES :=headers 
include $(CLEAR_VARS) 
LOCAL_C_INCLUDES += path_to/stlport 
LOCAL_SRC_FILES := $(libdash_src_files) 

include external/stlport/libstlport.mk 

LOCAL_SHARED_LIBRARIES += libstlport libz LOCAL_SYSTEM_SHARED_LIBRARIES :=libdl libutils libc 

LOCAL_LDLIBS := $(LOCAL_LDLIBS) -llog 

LOCAL_LDFLAGS:= -lz -Wl -shared 

LOCAL_CXX := $(CXX) 
libdash_cppflags :=-g -fPIC -v -frtti -fexceptions 

LOCAL_CPPFLAGS :=$(libdash_cppflags) -fpermissive -w 
LOCAL_MODULE :=libdash 
LOCAL_MODULE_TAGS :=optional 
include $(BUILD_SHARED_LIBRARY)

Solution

  • i just followed jermaine indications and did a make clean then build it again and it worked fine.

    Thanks guys.