> I feel the error is because the compiler we are using is gcc and not g
++..
probably you might use GNU make, u can specify compiler with CC option
'CC=g++' or 'CC=gcc'
You can also use -lstdc++ to make c++ sources compile with gcc.,
And android build system, picks g++/gcc automatically based on source being
compiled.., a sample below
caution: binaries built with GNU tools (linked with GNU libc), may not work
with android (which uses own libc bionic).
so, either use android tool chain or build 100% statically linked binaries
(no run time libc dependency, force static linking by adding -static flag)
--
Regards,
Deva
www.bittoggler.com
PS.
/data/md/hardware/ti/omap3/liboverlay$ cat Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_SHARED_LIBRARIES := liblog libcutils
LOCAL_SRC_FILES := v4l2_utils.c TIOverlay.cpp
LOCAL_MODULE := overlay.$(TARGET_BOARD_PLATFORM)
include $(BUILD_SHARED_LIBRARY)
d...@deva-ubunt:/data/build/l275/hardware/ti/omap3/liboverlay$ mm
showcommands
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2
TARGET_PRODUCT=blaze
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=MASTER
============================================
make: Entering directory `/data/build/l275'
target Non-prelinked: overlay_test
(out/target/product/blaze/symbols/system/bin/overlay_test)
out/host/linux-x86/bin/acp -fpt
out/target/product/blaze/obj/EXECUTABLES/overlay_test_intermediates/LINKED/overlay_test
out/target/product/blaze/symbols/system/bin/overlay_test
Install: out/target/product/blaze/system/bin/overlay_test
out/host/linux-x86/bin/acp -fpt
out/target/product/blaze/obj/EXECUTABLES/overlay_test_intermediates/overlay_test
out/target/product/blaze/system/bin/overlay_test
Copy: out/target/product/blaze/system/etc/apns-conf.xml
out/host/linux-x86/bin/acp -fpt device/ti/blaze/apns.xml
out/target/product/blaze/system/etc/apns-conf.xml
target thumb C++: overlay.omap4 <=
hardware/ti/omap3/liboverlay/TIOverlay.cpp
prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-g++ -I
hardware/ti/omap3/liboverlay -I
out/target/product/blaze/obj/SHARED_LIBRARIES/overlay.omap4_intermediates
-I dalvik/libnativehelper/include/nativehelper -I system/core/include -I
hardware/libhardware/include -I hardware/libhardware_legacy/include -I
hardware/ril/include -I dalvik/libnativehelper/include -I
frameworks/base/include -I frameworks/base/opengl/include -I
external/skia/include -I out/target/product/blaze/obj/include -I
bionic/libc/arch-arm/include -I bionic/libc/include -I
bionic/libstdc++/include -I bionic/libc/kernel/common -I
bionic/libc/kernel/arch-arm -I bionic/libm/include -I
bionic/libm/include/arch/arm -I bionic/libthread_db/include -c
-fno-exceptions -Wno-multichar -msoft-float -fpic -ffunction-sections
-funwind-tables -fstack-protector -fno-short-enums -march=armv7-a
-mfloat-abi=softfp -mfpu=neon -include
system/core/include/arch/linux-arm/AndroidConfig.h -I
system/core/include/arch/linux-arm/ -mthumb-interwork -DANDROID
-fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith
-DOMAP_ENHANCEMENT -DTARGET_OMAP4 -Werror=return-type
-Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -g
-Wstrict-aliasing=2 -finline-functions -fno-inline-functions-called-once
-fgcse-after-reload -frerun-cse-after-loop -frename-registers -DNDEBUG
-UDEBUG -fvisibility-inlines-hidden -DANDROID -fmessage-length=0 -W -Wall
-Wno-unused -Winit-self -Wpointer-arith -Wsign-promo -Werror=return-type
-Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG
-UDEBUG -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing
-finline-limit=64 -fno-rtti -DTARGET_OMAP4 -MD -o
out/target/product/blaze/obj/SHARED_LIBRARIES/overlay.omap4_intermediates/TIOverlay.o
hardware/ti/omap3/liboverlay/TIOverlay.cpp
target thumb C: overlay.omap4 <= hardware/ti/omap3/liboverlay/v4l2_utils.c
prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc -I
hardware/ti/omap3/liboverlay -I
out/target/product/blaze/obj/SHARED_LIBRARIES/overlay.omap4_intermediates
-I dalvik/libnativehelper/include/nativehelper -I system/core/include -I
hardware/libhardware/include -I hardware/libhardware_legacy/include -I
hardware/ril/include -I dalvik/libnativehelper/include -I
frameworks/base/include -I frameworks/base/opengl/include -I
external/skia/include -I out/target/product/blaze/obj/include -I
bionic/libc/arch-arm/include -I bionic/libc/include -I
bionic/libstdc++/include -I bionic/libc/kernel/common -I
bionic/libc/kernel/arch-arm -I bionic/libm/include -I
bionic/libm/include/arch/arm -I bionic/libthread_db/include -c
-fno-exceptions -Wno-multichar -msoft-float -fpic -ffunction-sections
-funwind-tables -fstack-protector -fno-short-enums -march=armv7-a
-mfloat-abi=softfp -mfpu=neon -include
system/core/include/arch/linux-arm/AndroidConfig.h -I
system/core/include/arch/linux-arm/ -mthumb-interwork -DANDROID
-fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith
-DOMAP_ENHANCEMENT -DTARGET_OMAP4 -Werror=return-type
-Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -g
-Wstrict-aliasing=2 -finline-functions -fno-inline-functions-called-once
-fgcse-after-reload -frerun-cse-after-loop -frename-registers -DNDEBUG
-UDEBUG -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing
-finline-limit=64 -DTARGET_OMAP4 -MD -o
out/target/product/blaze/obj/SHARED_LIBRARIES/overlay.omap4_intermediates/v4l2_utils.o
hardware/ti/omap3/liboverlay/v4l2_utils.c
target SharedLib: overlay.omap4
(out/target/product/blaze/obj/SHARED_LIBRARIES/overlay.omap4_intermediates/LINKED/
overlay.omap4.so)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-g++ -nostdlib
-Wl,-soname,overlay.omap4.so -Wl,-T,build/core/armelf.xsc -Wl,--gc-sections
-Wl,-shared,-Bsymbolic -Lout/target/product/blaze/obj/lib
out/target/product/blaze/obj/SHARED_LIBRARIES/overlay.omap4_intermediates/TIOverlay.o
out/target/product/blaze/obj/SHARED_LIBRARIES/overlay.omap4_intermediates/v4l2_utils.o
-Wl,--whole-archive -Wl,--no-whole-archive -llog -lcutils -lc
-lstdc++ -lm -o
out/target/product/blaze/obj/SHARED_LIBRARIES/overlay.omap4_intermediates/LINKED/
overlay.omap4.so -Wl,--no-undefined -Wl,--fix-cortex-a8
/data/build/l275/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a
target Non-prelinked: overlay.omap4
(out/target/product/blaze/symbols/system/lib/overlay.omap4.so)
On Fri, Sep 17, 2010 at 7:21 PM, jesna <[email protected]> wrote:
> Hi
> I am compiling a third party package(mvcdec) for android.I placed the
> package in external folder.and started compiling using the arm-tool
> chain :arm-2008q3 .The source code of mvcdec contains C++ files.And i
> was able to compile it in linux.They are using g++ for C++
> compilation..
>
> While compiling i am getting errors like this:home/user/
> Android_Eclair/home/RLS25E.16/mydroid/../../../arm-2008q3/arm-none-
> linux-gnueabi/include/c++/4.3.2/iostream:81: undefined reference to
> `std::ios_base::Init::Init()'.
>
> I feel the error is because the compiler we are using is gcc and not g
> ++..
> My question is how can we explicitly specify in the make command to
> use g++ for the mvcdec..
> Do i have to make any change in the Android.mk of mvcdec....
>
> I am new to android.The android version i am using is Eclair.so please
> help.....
> Thanks a lot in advance....
>
> Jesna
>
> --
> unsubscribe:
> [email protected]<android-porting%[email protected]>
> website: http://groups.google.com/group/android-porting
>
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting