在PC的Linux系统安装MiniGUI


一、下载MiniGUI

到官方网站:http://www.minigui.com/index.php?id=minigui-open-source-version&L=1

下载MiniGUI软件包,目前可免费下载的有二个版本,MiniGUI-STR V1.6.2和MiniGUI v1.3.3。MiniGUI v1.6是针对嵌入式开发的一个精简版本;MiniGUI v1.3.3是很稳定的版本了。我使用MiniGUI v1.3.3。打开官方网站后,注册一个用户,要下载的源码包:

MiniGUI图形库:
libminigui-1.3.3.tar.gz
MiniGUI资源包,包含字体,图标等:
minigui-res-1.3.3.tar.gz
MiniGUI示例程序:
mg-samples-1.3.0.tar.gz
一个综合的例程:
mde-1.3.0.tar.gz
在PC上运行这些例程,还需要一个工具:qvfb,在MiniGUI网站上有下载。
下载后,解压:
[root@localhost minigui]# tar zxvf libminigui-1.3.3.tar.gz
[root@localhost minigui]# tar zxvf minigui-res-1.3.3.tar.gz
[root@localhost minigui]# tar zxvf mg-samples-1.3.0.tar.gz
[root@localhost minigui]# tar zxvf mde-1.3.0.tar.gz
[root@localhost minigui]# tar zxvf qvfb-1.0.tar.gz

二、编译及安装
1、libminigui
[root@localhost minigui]# cd libminigui-1.3.3
[root@localhost libminigui-1.3.3]# make menuconfig
在make menuconfig中,有各种配置,可参考官方的《MiniGUI 用户手册》。
我只对以下配置修改:
System wide options   --->  

  • Build MiniGUI-Lite                         //选上,Lite版本               
    [ ] Stand-Alone                                                
    [ ] Use incore (built-in) resource                              
  • Unit of timer is 10ms                                       
  • Cursor support                                                 
  • User can move window with mouse                              
  • Mouse button can do double click                               
    [ ] Build with debugging messages                                  
    [ ] Trace messages of MiniGUI                                    
    [ ] Include symbol name of messages  
    Font options   --->
  • Raw bitmap font                                       
    [ ] Var bitmap font                    //不选择,否则编译,demo时,出错。                      
  • Incore font sansserif                                 
  • Incore font courier                                    
  • Incore font symbol                                    
  • Incore font vgas                                       
  • Qt Prerendered Font                                    
  • TrueType font                                          
  • Adobe Type1 font  
    在PC中,运行,只对这二点修改。
    如果配置没有问题,就可以执行:
    [root@localhost minigui]#make
    [root@localhost minigui]#make install
    注意:当make和make install没有出错后,不要以为一切OK了。一定要记得把“/usr/local/lib”添加到/etc/ld.so.conf文件中,运行ldconfig,否则,一会运行demo时,提示找不到图形库。类似,如:
    [root@localhost src]# ./helloworld
    ./helloworld: error while loading shared libraries: libminigui-1.3.so.3: cannot open shared object file: No such file or directory
    2、MiniGUI
    [root@localhost minigui]#cd minigui-res-1.3.x
    [root@localhost minigui]#make install
    默认安装在:/usr/local/lib/minigui/res/目录,安装这个一般很顺利,没有什么问题。
    3、编译例程mg-samples-1.3.0和mde-1.3.0
    如果libminigui-1.3.3编译,配置正确的话,这二个例程就是执行:
    #./configure
    #make
    #make install
    编译出问题,一般都是libminigui安装时,有问题。
    4、安装、配置qvfb
    [root@localhost minigui]# cd qvfb-1.0
    [root@localhost minigui]# ./configure
    出错:
    checking for X... configure: error: Can't find X includes. Please check your installation and add the correct paths!
    这个配置错误和minigui没有关系,只是PC上的linux系统没有安装X windows,qt等图形库相关,我重新安装qt和相关软件包,这个问题就可以解决了。
    [root@localhost minigui]#make
    [root@localhost minigui]#make install

    配置qvfb为minigui的图形引挚,修改:vim /usr/local/etc/MiniGUI.cfg
    # GAL engine和# IAL engine,如下:

    25 [system]
        26 # GAL engine
        27 #gal_engine=fbcon
        28 gal_engine=qvfb
        29
        30 # IAL engine
        31 #ial_engine=console
        32 ial_engine=qvfb
        33
        34 mdev=/dev/mouse
        35 mtype=IMPS2
        36
        37 [fbcon]
        38 defaultmode=1024x768-16bpp
        39
        40 [qvfb]
        41 defaultmode=640x480-16bpp
        42 display=0
    接关运行qvfb,启动虚拟帧缓冲区:
    [root@localhost libminigui-1.3.3]# qvfb &
    将弹出窗口:



    如果MiniGUI配置为MiniGUI-Lite版本的话,还要进mde-1.3.0/mginit目录,执行:./mginit,如果不执行,则有如下错误:
    [root@localhost src]# ./helloworld
    AttachSharedResource: No such file or directory
    Error in step 7: Can not attach shared resource!
    InitGUI failure when using /usr/local/etc/MiniGUI.cfg as cfg file.


    执行mginit,接着出现如下错误:
    [root@localhost mde-1.3.0]# mginit/mginit
    Can not create task bar.
    这个错误我找了很久,得不到解决,看了《用户手册》,执行:
    ldd mginit 命令后,得以解决。成功加载例程后,显示如:
    这个综合的demo有许多软件,其显示效果如下:

  • 相关内容