# VM Ware Workstation
# Ubuntu 12.04LTS
apt-get update
apt-get install vim
# cross compiler install
tar -xf arm-2009q3.tar.bz2 -C /usr/local/arm/
cd /root
vim .bashrc
# export PATH=$PATH:/usr/local/arm/arm-2009q3/bin
source .bashrc
# JDK install
tar -xf Android_JDK.tar.bz2 -C .
cd Android_JDK/jdk6
./install-sun-java6.sh
cd ..
./install-devel-packages.sh
# downgrade GCC to v4.4.7
apt-get install gcc-4.4 g++-4.4 g++=4.4-multilib gcc-4.4-multilib
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50
#include <stdio.h>
#include <string.h>
int main(int argc, char const *argv[])
{
int i, j;
i = atoi(argv[1]);
i = atoi(argv[2]);
printf("The programe name is %s\n", argv[0]);
printf("The command line has %d argument:\n", argc - 1);
printf("%d,%d\n", i, j);
return 0;
}