Linux 宿主机安装 MiniGUI

去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 出现错误

如图:

屏幕快照 2014 02 10 下午6 20 34

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 一下,又出现错误

屏幕快照 2014 02 11 上午12 38 48

这个错误别人很少有人犯。嵌入式开发最痛苦的不是难,而是烦,而且算法再难一帮人已经给你铺好路了,百度一搜一堆,嵌入式开发根本没几个人给你铺路,不会怎么办?百度谷歌没有,自己解决!

之前编译Linux 2.6 内核也往往会出现错误,所以看到这个错误也有一种相似感,突然灵感出现。

尼玛,这不就是gcc 编译器太高了。导致无法编译太低版本的Makefile 么?

怎么解决?凉拌!

顺藤摸瓜,将那个找不到的头文件注释一下就OK了。这种错误都是一样的。gcc 找不到 就注释一下,就可以蒙混过关了。

如图:

屏幕快照 2014 02 10 下午7 52 20

这样就可以编译成功了。

之后 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 : 我想说,宁可刷无比折磨人的算法题,也不想浪费时间在装这些嵌入式开发软件。太蛋疼了!

原文地址:https://www.cnblogs.com/firstrate/p/3543754.html