修改环境变量有多种方法我们介绍两种

(1)第一种方法:在当前终端输入如下内容(这种方法只在当前终端有效):

$export PATH=$PATH:/home/linux/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin:

(2)第二种方法:或直接修改/home/linux/.bashrc

进入用户目录:

cd /home/linux

vim .bashrc

添加如下内容:

PATH=$PATH:/home/linux/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin:

然后

source .bashrc

7.执行如下命令

$ arm-softfloat-linux-gnu-gcc -v

显示

Reading specs from /home/david/project/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/lib/gcc/arm-softfloat-linux-gnu/3.4.5/specs

Configured with: /home/david/downloads/crosstool-0.43/build/arm-softfloat-linux-gnu/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure --target=arm-softfloat-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/home/david/project/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu --with-float=soft --with-headers=/home/david/project/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/arm-softfloat-linux-gnu/include --with-local-prefix=/home/david/project/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/arm-softfloat-linux-gnu --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long

Thread model: posix

gcc version 3.4.5

ok交叉编译环境创建成功!

8.恢复我们修改的系统配置:

恢复gcc为4.3

sudo rm /usr/bin/gcc

sudo ln -s /usr/bin/gcc-4.3 /usr/bin/gcc

重新安装dash

sudo dpkg-reconfigure dash

选择 yes 以重新安装 dash

关于嵌入式技术就介绍完了,您有什么想法可以联系小编。