歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> mini2440 madplay移植出現問題解決

mini2440 madplay移植出現問題解決

日期:2017/3/1 10:19:32   编辑:Linux編程

剛剛開始,下決心學習linux,所以找出大學時候就購買的mini2440 拿出來折騰。

按照手冊一路模仿學習,其中出現不少問題,也都一個一個解決了。可惜那時候沒有想來,記錄這個過程。

這次在學習到手冊的第六章6.5嵌入式程序移植實例的時候出現了問題。看如下圖:

target-x86 裡面,我一直都沒得到 原來的庫文件。

這篇《友善之臂 madplayer 移植過程補充 》也出現過類似的或者說一模一樣的問題,把問題解決了,更重要的是分析出來。

問題一:

仔細一看,出現的錯誤:

configure: error: zlib.h was not found
*** You must first install zlibz(libz) before you can build this package.
*** If libmad is already installed, you may need to use the CPPFLAGS
*** environment variable to specify its installed location, e.g. -I<dir>.

然後我網上查找之後 得知 是缺少了zlib這個庫,所以網上找到 zlib-1.2.3.tar.gz 放在Ubuntu裡面安裝,然後編譯libid3tag 這個文件,ok順利通過了。

問題二:

接下來libmad文件出現問題

報錯是:

cc1: error: unrecognized command line option '-fforce-mem'
make[2]: *** [version.lo] Error 1
make[2]: Leaving directory `/opt/FriendlyARM/mini2440/madplay/src-x86/libmad-0.15.1b'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/FriendlyARM/mini2440/madplay/src-x86/libmad-0.15.1b'
make: *** [all] Error 2


百度了一下,原因是GCC3.4以上已經沒有-fforce-mem選項,找到相應的makefile,將該選項刪除就OK了!

具體是:

CFLAGS = -Wall -march=i486 -g -O -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -fstrength-reduce

修改為CFLAGS = -Wall -march=i486 -g -O

問題三:

編譯安裝madplay 出現如下問題:

checking for sys/soundcard.h... yes
checking machine/soundcard.h usability... no
checking machine/soundcard.h presence... no
checking for machine/soundcard.h... no
checking mad.h usability... no
checking mad.h presence... no
checking for mad.h... no
configure: error: mad.h was not found
*** You must first install libmad before you can build this package.
*** If libmad is already installed, you may need to use the CPPFLAGS
*** environment variable to specify its installed location, e.g. -I<dir>.
根據手冊 得知這是一個環境變量的問題

還有要輸進去的“--CPPFLAGS” “--LDFLAGS” 把前面的“--”去掉就好了。

到這裡應該就沒有什麼問題了。

root@ubuntu:/opt/FriendlyARM/mini2440/madplay# cd target-x86/
root@ubuntu:/opt/FriendlyARM/mini2440/madplay/target-x86# ls
bin include lib man share
root@ubuntu:/opt/FriendlyARM/mini2440/madplay/target-x86# ls bin
abxtest madplay
root@ubuntu:/opt/FriendlyARM/mini2440/madplay/target-x86#

Copyright © Linux教程網 All Rights Reserved