cross compiler

1. 把编译好的工具链放到相应目录下,我的是/aesop/cross/

2.

gedit ~/.bash_profile

add the content:

PATH=$PATH:/aesop/cross/bin

source ~/.bash_profile

 

/* On Ubuntu */

vim ~/.bashrc

add at the end of file

PATH=$PATH:/aesop/cross/bin
export PATH
/* So that , you do not need to source every time */

try it:

arm-linux-gcc -v

 

3. test helloworld.

root@ubuntu:/aesop/rootfs/root# arm-linux-gcc hello.c -o hello
/aesop/cross/bin/../lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/ld.real:找不到 /usr/local/arm-linux/lib/libc.so.6
collect2: ld returned 1 exit status
solution:

cd /usr/local/

ln -s /aesop/cross/arm-linux arm-linux

 

 

2010-03-22

REF http://www.mediacollege.com/linux/red-hat/path-variable.html

How to set the $PATH variable in Redhat 9.0

The $PATH variable is a list of which directories Redhat will look in for executable files.

To see what the current path is, type...
echo $PATH
You should get something like the following...

/usr/local/bin:/bin:/usr/bin:/home/myname/bin

This means that when you try to run a program or script (eg: ping, ftp or vi etc), Redhat will look in /usr/local/bin then /bin , /usr/bin and finally in /home/myname/bin to find it.

You can change the path to suit your needs.

EXAMPLE:
To add /sbin to the path, type
export PATH=$PATH:/sbin
To see the result, type...
echo $PATH

/usr/local/bin:/bin:/usr/bin:/home/myname/bin:/sbin

 

我机子上的示例:

[root@localhost root]# echo $PATH
/root/bin
[root@localhost root]# export PATH=$PATH:/usr/local/bin:/bin:/usr/bin:
[root@localhost root]# echo $PATH
/root/bin:/usr/local/bin:/bin:/usr/bin:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值