为什么臂的Linux androideabi-GCC给iostream的错误 [英] why does arm-linux-androideabi-gcc give iostream error

查看:502
本文介绍了为什么臂的Linux androideabi-GCC给iostream的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的手臂,Linux的androideabi-gcc的安装在我的电脑,但是当我尝试编译甚至一个简单的hellow世界,它给错误(我选择不使用NDK建造)。我只是想通过命令行编译...

 的#include<的iostream>

使用名字空间std;

诠释的main(){
    返回0;
}
 

和我收到此错误:

  

错误:iostream的:没有这样的文件或目录

我有臂的linux-androideabi-GCC在〜/ Android的NDK-R8B /工具链/ ARM-Linux的androideabi-4.4.3 / prebuilt / Linux的-86 /箱

我都试过,包括 -I〜/ Android的NDK-R7B /平台/ Android的9 /弓臂的/ usr

我也尝试包括 -lstdc ++ 只是为了看看它的工作原理,但没有...

  ./臂的Linux androideabi-G ++ -o FF first.cpp -I /家庭/哈利/ Android的NDK-R7B /平台/ Android的9 /弓臂/ USR -lstdc ++
 

解决方案

首先,您需要创建独立的工具链:

  make-standalone-toolchain.sh --platform =机器人-14 --install-DIR =独立的工具链--ndk-DIR = $ ANDROID_NDK_PATH
 

导出路径:

 导出路径= $ TOOLCH /独立的工具链/斌:$ PATH
 

然后建立文件:

  ARM-Linux的androideabi-G ++ -o测试新TEST.CPP
 

注:使用发行版本8B这是NDK的最新版本:<一href="http://$c$c.google.com/p/android/issues/detail?id=35279">http://$c$c.google.com/p/android/issues/detail?id=35279

  ARM-Linux的androideabi-G ++ -o测试新TEST.CPP --sysroot = $ TOOLCH / SYSROOT
-I $ TOOLCH / lib中/ GCC / ARM-Linux的androideabi / 4.6.X,谷歌/包括
-I $ TOOLCH / lib中/ GCC / ARM-Linux的androideabi / 4.6.X,谷歌/包括,固定
-I $ TOOLCH / ARM-Linux的androideabi /有/ C ++ / 4.6
-I $ TOOLCH / ARM-Linux的androideabi /有/ C ++ / 4.6 / ARM-Linux的androideabi
-I $ TOOLCH / SYSROOT / usr / include目录
 

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 just want to compile from the command line ...

#include <iostream>

using namespace std;

int main (){
    return 0;
}

And I received this error:

error: iostream: No such file or directory

I have the arm-linux-androideabi-gcc in ~/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin .

I have tried including -I ~/android-ndk-r7b/platforms/android-9/arch-arm/usr

I have also tried including -lstdc++ just to see if it works but no ...

./arm-linux-androideabi-g++ -o ff first.cpp -I /home/hari/android-ndk-r7b/platforms/android-9/arch-arm/usr -lstdc++

解决方案

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

这篇关于为什么臂的Linux androideabi-GCC给iostream的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆