Install gcc on iOS

This is what I referred and I succeeded installing gcc on my ipad 1 with iOS 5.1.1.

http://www.ccvita.com/517.html


1. Prepare the terminal:

There are 2 options:

option 1 : Cydia install Terminal

option 2 : First install in Cydia OpenSSH and pTerm. Then use pTerm to connect 127.0.0.1 with password "alpine".

2. Start GCC installation

(1) install wget to download everything needed

 
 
apt-get install wget

(2) install libgcc

 
 
wget http://apt.saurik.com/debs/libgcc_4.2-20080410-1-6_iphoneos-arm.deb
dpkg -i libgcc_4.2-20080410-1-6_iphoneos-arm.deb

(3) install gcc

 
 
apt-get install iphone-gcc

(4) download the header files and libraries that gcc needed and then copy them to the system directory

 
 
wget http://www.syshalt.net/iphone/gcc-iphone/sdk-2.0-headers.tar.gz
tar -xvzf sdk-2.0-headers.tar.gz
cd include-2.0-sdk-ready-for-iphone
cp -r * /usr/include
cd..
wget http://www.syshalt.net/iphone/gcc-iphone/gcc_files.tar.gz
tar -xvzf gcc_files.tar.gz
cd gcc_files
cp -r * /usr/lib

(5) install useful command and libraries

 
 
apt-get install ldid
apt-get install make
apt-get install vim
apt-get install curl
apt-get install sqlite3

(6) now we could use "gcc" as command like "gcc hello.c -o hello"

But don't forget to ldid the executive file (here is "hello") before running.

 
 
ldid S <application>

References:
http://code.google.com/p/iphone-gcc-full/issues/detail?id=6
http://iklive.org/cc-compiling-on-ios/
http://stackoverflow.com/questions/14710849/get-gnu-c-compiler-working-on-ios-6-x/


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值