去MiniGUI官方網站看的時候,很興奮,安裝竟然這么容易。
上帝總是在給你一個蘋果之后,賞你一巴掌。我的確是高興太早了。
首先看一下官網文檔的說明步驟:
(截取于官方文檔)
Installing resource files of MiniGUI
We must install resource files of MiniGUI first. Please follow the steps below to do it:
1) Use `tar' to extract minigui-res-be-3.0.12.tar.gz. You can use the following command: $ tar zxf minigui-res-be-3.0.12.tar.gz 2) Change to the new directory and run `configure' and `make install' as a super user:
$ ./configure
$ sudo make install
Configure and compile MiniGUI
MiniGUI uses `automake' and `autoconf', so configuration and compilation of MiniGUI are very easy:
1) Use `tar' to extract `libminigui-gpl-3.0.12.tar.gz' to a new directory: $ tar zxf libminigui-gpl-3.0.12.tar.gz 2) Change to the new directory and run `./configure': $ ./configure 3) Run the following commands to compile and install MiniGUI: $ make; sudo make install; 4) By default, the libraries of MiniGUI will be installed in `/usr/local/lib'. You should make sure that this directory is listed in `/etc/ld.so.conf' file. And after having installed them, you should run the following command to update the cache of shared library system: $ sudo ldconfig 5) If you want to specify which features MiniGUI provides, you can run $ ./configure --help to see the complete configuration options listed, then disable or enable some features by using command line switches. For example, if you do not want MiniGUI to load JPEG pictures via the function LoadBitmap, you can use $ ./configure --disable-jpgsupport 6) Note that some features of MiniGUI depend on other libraries. Please make sure that you have installed them.
Run samples of MiniGUI
Before running the sample programs, you should extract the mg-samples-3.0.12.tar.gz and compile it:
1) Extract the tarball to a new directory by using `tar' command. 2) Run `./configure' and `make' to compile the demos. $ ./configure $ make 3) Try to run the samples. For example, you can go to `mg-samples-3.0.12/same/' to run `same': $ cd same $ ./same
?
先下載四個文件:minigui-res-be-3.0.12.tar、libminigui-gpl-3.0.12.tar、mg-samples-3.0.12.tar、qvfb2-2.0.tar
這四個是裝 MiniGUI 最基本的四個文件。
步驟流程幾乎都是以下三步:
1、 ./configure
2、make
3、make install
但如果能像官方文檔那樣一個錯誤沒有就PASS的話,那一定是中了六合彩了。
下面來記錄以下我當時發生的種種錯誤。
剛開始 ./configure 會出現權限錯誤,咦,我是root用戶,我是上帝,為什么會錯?Linux 有個區域是上帝禁區,你就是沒權利。
好吧。那怎么辦?
bash ./configure ?這樣就OK了。我不會告訴你why,因為我自己也不知道。
之前有用 ?./configure 無法應用,所以直接用 sudo sh configure 這樣執行,但是會出現小的BUG,即使不會報錯,會影響庫的完整性。
最先安裝?minigui-res-be-3.0.12.tar 這個是最順利的。
其次安裝?libminigui-gpl-3.0.12.tar ?
安裝后修改 /etc/ld.so.conf 文件,在里面最后新加入一行 /usr/local/lib?
然后執行 ldconfig 更新庫文件
OK!
現在安裝?qvfb2-2.0.tar
./configure
報錯:
checking for Qt... configure: error: Qt (>= Qt 3.0.3) (headers and libraries) not found. Please check your
installation!
For more details about this problem, look at the end of config.log.
原因:裝它之前 先要安裝 Qt
Qt 安裝步驟:
如果報錯,就檢查g++是否存在。
首先,確保 g++ 存在,如若沒安裝,就 yum install gcc-c++ ?安裝一下就OK了
其次,安裝??yum install qt3-devel ?,由于 qvfb2 或者 qvfb1 需要的是qt3,你裝qt4、qt2 都會報錯。
這就是所謂linuxer 無奈的地方,越自由,越會受到開發者的局限,你要是用人家軟件,就要遵從人家的狗P規則。
安裝Qt后繼續報相同錯誤。
之后看網上評論:
?
某網友寫:?
yum install qt3-devel ?可以安裝,但是裝出來的有qt3的東西 也有qt4的,不能用,仍報上面的錯誤,所以要刪掉qt4
直接用yum安裝可以避免該問題: yum install qt-devel-3.3.8-4.fc7.i386.rpm
?
可惜我沒那么大耐心重裝,你無法想象重裝是多么考驗人的耐心。任何事情都有解決的方法。
解決方法:
$bash ./configure --with-qt-dir=/usr/lib/qt-3.3 --with-qt-includes=/usr/lib/qt-3.3/include
這樣就可以順利編譯了,只是 configure 要指定QT庫函數而已。
qvfb2 已經安裝好后,直接在命令行輸入 qvfb2 ,會輸出一行:oops:client1 : No such file or directory
咦?安裝失敗?
又繼續查資料。。。發現,qvfb版本2 是無法直接在命令行執行的。也就是說安裝成功了。我撤,那怎么測試?
安裝好最后一個庫就可以測試了!
庫mg-samples-3.0.12.tar 骨灰級,耗費了我2個小時在裝這個庫。
開始./configure 出現錯誤
如圖:
?
?
No package 'minigui' found .. 我擦,重新安裝幾次lib庫還是沒反應。這讓我怎么辦?
網上少部分人也說:設置PKG_CONFIG_PATH 變量,隨便設置一下也是不行。
百般無奈下,換了root 用戶,繼續重新安裝minigui-res-be-3.0.12.tar、libminigui-gpl-3.0.12.tar,有可能是lib庫問題,沒有裝好,安裝好后,還是出現以上問題。幾乎裝了兩遍還是不好使。
之后, 重裝完 libminigui-gpl 三遍后
輸入:export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/?
之后 居然成功了。。我撤。終于逃離苦海了。
但是能笑到最后的人很少很少。。。
接下來
make 一下,又出現錯誤
?
?
這個錯誤別人很少有人犯。嵌入式開發最痛苦的不是難,而是煩,而且算法再難一幫人已經給你鋪好路了,百度一搜一堆,嵌入式開發根本沒幾個人給你鋪路,不會怎么辦?百度谷歌沒有,自己解決!
之前編譯Linux 2.6 內核也往往會出現錯誤,所以看到這個錯誤也有一種相似感,突然靈感出現。
尼瑪,這不就是gcc 編譯器太高了。導致無法編譯太低版本的Makefile 么?
怎么解決?涼拌!
順藤摸瓜,將那個找不到的頭文件注釋一下就OK了。這種錯誤都是一樣的。gcc 找不到 就注釋一下,就可以蒙混過關了。
如圖:
?
這樣就可以編譯成功了。
之后 cd same ; ./same?
出現錯誤:
Does not find matched engine: qvfb.
InitGUI (step 4): Can not get graphics engine information!
?
作為 初級嵌入式的linuxer 不出錯才是一件怪事。。。
?
某網友說 :
解決方法:啟動qvfb &
qvfb2 根本無法啟動的擦,后臺啟動也沒用。
之后找到個網友正規一點的:
代碼如下:
?
# vi /usr/local/etc/MiniGUI.cfg 在里面找到 [system] # GAL engine #gal_engine=fbcon gal_engine=qvfb //這里修改 # IAL engine #ial_engine=console ial_engine=qvfb //這里修改 mdev=/dev/mouse mtype=IMPS2 [fbcon] defaultmode=1024x768-16bpp [qvfb] defaultmode=640x480-16bpp display=0
?
結果錯誤還是一樣。
最終發現被網友誤導了。
不能說網友說的不對,這種方法應該是適合 MiniGui v1 ~ v2 .
v3版本改了,而且是剛出不久,所以很多東西都要自己去實踐、探索。
對于官方這配置文件,真的很無語。
所以求穩定,好配置,版本越低越好,版本越高錯誤越多。
改這個文件是對的,不過其實只要改一處就可以了。
?
[pc_xvfb] defaultmode=1024x768-16bpp window_caption=XVFB-for-MiniGUI-3.0-(Qt-Version) exec_file=/usr/local/bin/qvfb2 [只改這里,其他地方不改]
?
?
改了這一處后,就成功執行了!出現掃雷畫面那一刻,淚水都嘩嘩的啦。。。
不過革命還要繼續!
明天任務是將MiniGUI 移植到龍芯2H板子上。
下面這些文件是MiniGUI 完善應用的軟件:
?
?
?
?
?
Ps : 我想說,寧可刷無比折磨人的算法題,也不想浪費時間在裝這些嵌入式開發軟件。太蛋疼了!
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
