基于linux下交叉编译minigui体会

 能不用minigui就不用是对的,这段时间一直在交叉编译minigui,困难是妥妥的多,几乎每一个包都有问题,现在我就记录下碰到的问题,大部分都是在网上找的解决办法,网上还是大神多啊,下载的库都是在minigui官网下的,有些问题是库的问题,低版本库有问题,高版本库自己就好了,自己也是莫名其妙。

[编译zlib库:]
CC=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc \
CXX=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-g++ \
LD=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ld \
AS=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-as \
AR=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ar  \
./configure --prefix=/home/lq/build/lq_work/minigui --shared 




[编译png库:]
CC=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc \
CXX=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-g++ \
LD=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ld \
AS=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-as \
AR=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ar  \
CPPFLAGS="-g -I/home/lq/build/lq_work/minigui/include" \
LDFLAGS="-L/home/lq/build/lq_work/minigui/lib" \
./configure --prefix=/home/lq/build/lq_work/minigui \
--build=x86_64-linux \
--host=arm-linux-gnueabihf \
--target=arm-linux-gnueabihf


错误:
configure: error: zlib not installed


解决方法:
加下面的库和头文件
CPPFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
LDFLAGS="-L/home/lq/build/lq_work/minigui/lib"




[编译jpeg库:]
CC=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc \
CXX=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-g++ \
LD=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ld \
AS=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-as \
AR=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ar  \
./configure --prefix=/home/lq/build/lq_work/minigui \
--build=x86_64-linux \
--host=arm-linux-gnueabihf \
--target= arm-linux-gnueabihf


[编译1.3.1 freetype库]
其他版本的库就编译下面这行 我碰见的错误就下面那个
./configure --host=arm-linux-gnueabihf --prefix=/home/lq/build/lq_work/minigui --with-freetype=/home/lq/build/lq_work/minigui/freetype/
 vi /home/lq/build/lq_work/minigui/freetype-2.3.9-fm20100818/builds/unix/install.mk +50 注释掉
make &&make install
编译1.3.1 freetype库需要用到
 vim config.cache
ac_cv_path_LD=${ac_cv_path_LD=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ld}
ac_cv_prog_CC=${ac_cv_prog_CC=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc}
ac_cv_prog_CPP=${ac_cv_prog_CPP='/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-g++ -E'}
重新配置
./configure --host=arm-linux-gnueabihf --prefix=/home/lq/build/lq_work/minigui
#修改Makefile文件,以跳过编译test目录。
#去掉“all:”后的变量“tttest”
#注释掉“install:”下的第二行:“cd $(FTTESTDIR); $(MAKE) –f$(MAKEFILE) install”


[编译minigui-res-be-3.0.12资源库]
CC=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc \
CXX=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-g++ \
LD=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ld \
AS=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-as \
AR=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ar  \
./configure --prefix=/home/lq/build/lq_work/minigui




[编译libminigui-gpl-3.0.12核心库]
CC=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc \
CXX=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-g++ \
LD=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ld \
CFLAGS="-g -fgnu89-inline -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
CPPFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
CXXFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
LDFLAGS="-L/home/lq/build/lq_work/minigui/lib" \
./configure --enable-pngsupport --prefix=/home/lq/build/lq_work/minigui \
--build=x86_64-linux \
--host=arm-linux-gnueabihf \
--target= arm-linux-gnueabihf
错误:


将_va=va改成va_copy(_va=va) ;


[编译libmgplus-1.2.4库]
CC=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc \
CXX=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-g++ \
LD=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ld \
CFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
CPPFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
CXXFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
LDFLAGS="-L/home/lq/build/lq_work/minigui/lib " \
MINIGUI_CFLAGS="-I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
 MINIGUI_LIBS="-L/home/lq/build/lq_work/minigui/lib -lminigui_ths -ljpeg -lpng -ldl -lm -lpthread " \
./configure --prefix=/home/lq/build/lq_work/minigui \
--build=x86_64-linux \
--host=arm-linux-gnueabihf \
--target= arm-linux-gnueabihf


[编译mg-samples]
CC=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-gcc \
CXX=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-g++ \
LD=/usr/local/linaro-armv7ahf-2015.11-gcc5.2/bin/arm-linux-gnueabihf-ld \
CFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
CPPFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
CXXFLAGS="-g -I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
LDFLAGS="-L/home/lq/build/lq_work/minigui/lib " \
MINIGUI_CFLAGS="-I/home/lq/build/lq_work/minigui/include -I/usr/local/linaro-armv7ahf-2015.11-gcc5.2/include/" \
MINIGUI_LIBS="-L/home/lq/build/lq_work/minigui/lib -lminigui_ths -ldl -lpthread -lm  -lpng -ljpeg -lz" \
./configure --prefix=/home/lq/build/lq_work/minigui \
--build=x86_64-linux \
--host=arm-linux-gnueabihf \
--target= arm-linux-gnueabihf
错误:
libminigui_ths.so定义未申明
在核心库CLFAGS加上 -fgnu89-inline
libpng.so定义未申明
加上 -lz
MINIGUI_LIBS="-L/home/lq/build/lq_work/minigui/lib -lminigui_ths -lpng -ljpeg -ldl -lm -lpthread -lz" \


在开发板上运行:
修改配置
$ vim /usr/local/minigui/etc/MiniGUI.cfg
02  # 修改如下参数
03  # GAL engine and default options
04  gal_engine=fbcon
05   
06  # IAL engine
07  ial_engine=console
08  mdev=/dev/input/mice
09  mtype=IMPS2
10   
11  # 根据实际的显示大小填
12  [fbcon]
13  defaultmode=480x272-16bpp


运行sample问题总结
(1)./helloworld: error while loading shared libraries: libminigui_ths-3.0.so.12: cannot open shared object file: No such file or directory
解决:
export LD_LIBRARY_PATH=/sdcard/ \
export LD_LIBRARY_PATH=/sdcard/lib:$LD_LIBRARY_PATH


(2)MISC: Can not locate your MiniGUI.cfg file or bad files!
KERNEL>InitGUI: Initialization of misc things failure!
解决:把libminigui-gpl-3.0.12/etc/MiniGUI.cfg复制到当前目录下[mg-samples-3.0.12/src]
(3)KERNEL>InitGUI: Count not init mouse cursor!
KERNEL>InitGUI: Init failure, please check your MiniGUI configuration or resource.
解决:
修改MiniGUI.cfg配置文件


[cursorinfo]
108 # Edit following line to specify cursor files path
109 #cursorpath=/usr/local/share/minigui/res/cursor/
110 cursorpath=/sdcard/share/minigui/res/cursor/
111 cursornumber=23


[resinfo]
137 #respath=/usr/local/share/minigui/res/
138 respath=/sdcard/share/minigui/res/


本来还有个unknow type png的错误,在核心库添加LDCAFLAGS就好了,交叉编译好了,正式进入项目开发!!

你可能感兴趣的:(基于linux下交叉编译minigui体会)