I want to cross-compile a program which includes C and C++ both header file (ex. stdio.h and iostream) using arm-linux-androideabi-g++.
I use this command:
arm-linux-androideabi-g++ --sysroot=/home/user/android/android-ndk-r12b/platforms/android-18/arch-arm -I /home/user/android/android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/include -I /home/user/android/android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -o demo1 demo.cpp
I get this error:
/tmp/ccnVY2tc.o:demo.cpp:function __static_initialization_and_destruction_0(int, int): error: undefined reference to 'std::ios_base::Init::Init()'
/tmp/ccnVY2tc.o:demo.cpp:function __static_initialization_and_destruction_0(int, int): error: undefined reference to 'std::ios_base::Init::~Init()'
collect2: error: ld returned 1 exit status
How can I solve this problem?