why does arm-linux-androideabi-gcc give iostream error

前端 未结 3 1994
不思量自难忘°
不思量自难忘° 2020-12-21 00:06

I have arm-linux-androideabi-gcc installed in my computer, but when I try to compiler even a simple hellow world, it gives error ( I am choosing not to use ndk-build ) . I j

相关标签:
3条回答
  • 2020-12-21 00:30

    Look at the error: iostream: No such file or directory

    #include "iostream" should be #include #include <iostream>

    0 讨论(0)
  • 2020-12-21 00:32

    According to http://code.google.com/p/android/issues/detail?id=35279 , this is a bug of the standalone toolchain. I think the best fix-around is ln -s $TOOLCH/arm-linux-androideabi/include/c++/4.6 $TOOLCH/arm-linux-androideabi/include/c++/4.6.x-google

    0 讨论(0)
  • 2020-12-21 00:46

    First you need to create the standalone toolchain:

    make-standalone-toolchain.sh --platform=android-14 --install-dir=standalone-toolchain --ndk-dir=$ANDROID_NDK_PATH
    

    export the PATH:

    export PATH=$TOOLCH/standalone-toolchain/bin:$PATH
    

    Then build the file:

    arm-linux-androideabi-g++ -o test-new test.cpp
    

    Note: issue using revision 8b which is the latest version of the NDK: http://code.google.com/p/android/issues/detail?id=35279

    arm-linux-androideabi-g++ -o test-new test.cpp --sysroot=$TOOLCH/sysroot
    -I$TOOLCH/lib/gcc/arm-linux-androideabi/4.6.x-google/include
    -I$TOOLCH/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed
    -I$TOOLCH/arm-linux-androideabi/include/c++/4.6
    -I$TOOLCH/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi
    -I$TOOLCH/sysroot/usr/include
    
    0 讨论(0)
提交回复
热议问题