• 本帖最后由 aite.me 于 2012-6-2 08:18 编辑 *

1.在google play中下载c4droid的gcc插件(18mb)

  1. 解压gcc插件,解压apk后在众多文件中找到gcc.zip文件

3打开安卓终端模拟器执行以下命令:- - $ su

  • # unzip gcc.zip
  • # cp -r ./gcc /data/data/
  • # mv /data/data/gcc /data/data/android.gcc
  • # mount -o remount,rw /system
  • # cd /system/bin
  • # ln -s /data/data/android.gcc/bin/arm-linux-androideabi-gcc gcc
  • # ln -s /data/data/android.gcc/bin/arm-linux-androideabi-g++ g++
  • # mount -o remount,ro /system
  • # chmod -R 0777 /data/data/android.gcc
  • # exit
  • $ exit
  • 复制代码gcc and g++ for android就安装完成了!

试一下gcc吧!
建立文件love.c写入:- - #include

  • int main(void) {
  • printf("welcome to aite.me!");
  • }
  • 复制代码然后执行gcc -static love.c -o aite.me

将生成的aite.me文件移动到/system/bin并赋予执行权限在终端下执行aite.me试看吧!