1. 程式人生 > >交叉編譯器環境變數配置正確了,但是無法使用

交叉編譯器環境變數配置正確了,但是無法使用

這是自己親身經歷的一個問題:在正確配置了arm-none-linux-gnueabi-gcc環境變數之後,終端輸入arm-none-linux-gnueabi-gcc --version:

bash: /home/lin/kernel/arm-2010q1/bin/arm-none-linux-gnueabi-gcc: No such file or directory

然後你寫一個helloworld.c都無法編譯,可是他明明在那裡,是不是很奇葩?!

百度後發現是32位和64位不相容,需要安裝32位相容庫。我的系統是64位的Ubuntu。

好了,問題的解決點就在我用的是64位系統,別人又說,使用 sudo 
apt-get
install ia32-libs命令就可以解決。然而安裝之後,是這樣:

E: Package 'ia32-libs' has no installation candidate

Reading package lists... Done
Building dependency tree 
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or

is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0 
這個時候,只要再去安裝上面的lib32z1 lib32ncurses5 lib32bz2-1.0 這幾個庫就好了:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 
解決完畢!