(1) 编译libminigui-1.3.3出错:
varbitmap.c:248: error: static declaration of 'var_bitmap_font_ops' follows non-static declaration
具体错误如下:
source='varbitmap.c' object='varbitmap.lo' libtool=yes \
depfile='.deps/varbitmap.Plo' tmpdepfile='.deps/varbitmap.TPlo' \
depmode=gcc3 /bin/sh ../../depcomp \
/bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -I../include -g -O2 -D__MINIGUI_LIB__ -D_REENTRANT -O2 -Wall -Wstrict-prototypes -pipe -DNDEBUG -c -o varbitmap.lo `test -f 'varbitmap.c' || echo './'`varbitmap.c
rm -f .libs/varbitmap.lo
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -I../include -g -O2 -D__MINIGUI_LIB__ -D_REENTRANT -O2 -Wall -Wstrict-prototypes -pipe -DNDEBUG -c varbitmap.c -MT varbitmap.lo -MD -MP -MF .deps/varbitmap.TPlo -fPIC -DPIC -o .libs/varbitmap.lo
varbitmap.c:248: error: static declaration of 'var_bitmap_font_ops' follows non-static declaration
varbitmap.h:38: error: previous declaration of 'var_bitmap_font_ops' was here
make[4]: *** [varbitmap.lo] 错误 1
make[4]: Leaving directory `/home/source/minigui/minigui1.3.x/libminigui-1.3.3/src/font'
make[3]: *** [all-recursive] 错误 1
make[3]: Leaving directory `/home/source/minigui/minigui1.3.x/libminigui-1.3.3/src/font'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/home/source/minigui/minigui1.3.x/libminigui-1.3.3/src'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/source/minigui/minigui1.3.x/libminigui-1.3.3'
make: *** [all] 错误 2
出错原因:
在src/font/varbitmap.h中定义了extern FONTOPS var_bitmap_font_ops,那里var_bitmap_font_ops为extern类型的,而在src/font/varbitmap.c中定义的是static类型,所以可能造成了编译的出错。
解决方法如下:
修改src/font/varbitmap.c文件:
//static FONTOPS var_bitmap_font_ops = {
extern FONTOPS var_bitmap_font_ops = { // wmmwang 修改
还有一个type1也修改了staic为extern
(2) 有些代码错误:
In file included from defkeymap.c:15:
keyboard.h:43: error: expected ')' before '*' token
keyboard.h:49: error: expected specifier-qualifier-list before 'INIT_KBD_LAYOUT'
keyboard.h:52: error: expected ')' before '*' token
defkeymap.c:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'plain_map'
defkeymap.c:36: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'shift_map'
defkeymap.c:55: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'altgr_map'
defkeymap.c:74: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ctrl_map'
defkeymap.c:93: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'shift_ctrl_map'
defkeymap.c:112: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'alt_map'
defkeymap.c:131: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ctrl_alt_map'
defkeymap.c:150: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
defkeymap.c:267: error: expected ')' before '*' token
修改办法是:
1 打开src/gui/defkeymap.c,将所有ushort改为u_short
2 打开src/gui/keyboard.h,将所有ushort改为u_short,并在前面添加u_short的定义:
typedef unsigned short u_short;
(3) PAGE_SIZE
fbvideo.c:38:63: error: asm/page.h: No such file or directory
fbvideo.c: In function 'FB_VideoInit':
fbvideo.c:543: error: 'PAGE_SIZE' undeclared (first use in this function)
fbvideo.c:543: error: (Each undeclared identifier is reported only once
fbvideo.c:543: error: for each function it appears in.)
make[4]: *** [fbvideo.lo] 错误 1
make[4]: Leaving directory `/home/changyongid/minigui/libminigui-1.3.3/src/newgal/fbcon'
make[3]: *** [all-recursive] 错误 1
make[3]: Leaving directory `/home/changyongid/minigui/libminigui-1.3.3/src/newgal'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/home/changyongid/minigui/libminigui-1.3.3/src'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/changyongid/minigui/libminigui-1.3.3'
make: *** [all] 错误 2
vim src/newgal/fbcon/fbvideo.c
在下面定义
#define PAGE_SIZE 4096
(4) grid.c: In function 'AddCol':
grid.c:626: error: invalid lvalue in assignment
grid.c:627: error: invalid lvalue in assignment
grid.c:640: error: invalid lvalue in assignment
grid.c:641: error: invalid lvalue in assignment
grid.c:669: error: invalid lvalue in assignment
grid.c:670: error: invalid lvalue in assignment
grid.c:682: error: invalid lvalue in assignment
grid.c:683: error: invalid lvalue in assignment
grid.c: In function 'AddRow':
grid.c:735: error: invalid lvalue in assignment
grid.c:736: error: invalid lvalue in assignment
grid.c:747: error: invalid lvalue in assignment
grid.c:748: error: invalid lvalue in assignment
grid.c:776: error: invalid lvalue in assignment
grid.c:777: error: invalid lvalue in assignment
grid.c:790: error: invalid lvalue in assignment
grid.c:791: error: invalid lvalue in assignment
具体错误如下:
source='grid.c' object='grid.lo' libtool=yes \
depfile='.deps/grid.Plo' tmpdepfile='.deps/grid.TPlo' \
depmode=gcc3 /bin/sh ../../depcomp \
/bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I./ -I../include -I../../include -g -O2 -D__MINIGUI_LIB__ -D_REENTRANT -O2 -Wall -Wstrict-prototypes -pipe -DNDEBUG -c -o grid.lo `test -f 'grid.c' || echo './'`grid.c
rm -f .libs/grid.lo
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I./ -I../include -I../../include -g -O2 -D__MINIGUI_LIB__ -D_REENTRANT -O2 -Wall -Wstrict-prototypes -pipe -DNDEBUG -c grid.c -MT grid.lo -MD -MP -MF .deps/grid.TPlo -fPIC -DPIC -o .libs/grid.lo
grid.c: In function 'AddCol':
grid.c:626: error: invalid lvalue in assignment
grid.c:627: error: invalid lvalue in assignment
grid.c:640: error: invalid lvalue in assignment
grid.c:641: error: invalid lvalue in assignment
grid.c:669: error: invalid lvalue in assignment
grid.c:670: error: invalid lvalue in assignment
grid.c:682: error: invalid lvalue in assignment
grid.c:683: error: invalid lvalue in assignment
grid.c: In function 'AddRow':
grid.c:735: error: invalid lvalue in assignment
grid.c:736: error: invalid lvalue in assignment
grid.c:747: error: invalid lvalue in assignment
grid.c:748: error: invalid lvalue in assignment
grid.c:776: error: invalid lvalue in assignment
grid.c:777: error: invalid lvalue in assignment
grid.c:790: error: invalid lvalue in assignment
grid.c:791: error: invalid lvalue in assignment
make[3]: *** [grid.lo] 错误 1
make[3]: Leaving directory `/home/source/minigui/minigui1.3.x/libminigui-1.3.3/ext/control'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/home/source/minigui/minigui1.3.x/libminigui-1.3.3/ext'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/source/minigui/minigui1.3.x/libminigui-1.3.3'
make: *** [all] 错误 2
出错原因:
未知。可能是编译器版本太高的缘故。
解决方法如下:
将上面出错的grid.c文件中对应行数的强制转换去掉。例如grid.c:626、627行修改如下:
//(PGRIDCOLHDR)pCell1->pRowHdr = pRowHdr;
//(PGRIDCOLHDR)pCell1->pColHdr = pCol1;
pCell1->pRowHdr = pRowHdr;
pCell1->pColHdr = pCol1;
其他出错行同上修改
(5) /usr/local/lib/libminigui.so: undefined reference to `pthread_kill_other_threads_np'
collect2: ld 返回 1
make[1]: *** [helloworld] 错误 1
make[1]: Leaving directory `/4020/minigui/mg-samples-1.3.1/src'
make: *** [all-recursive] 错误 1
解决方法如下:
修改libminigui/src/kernel/init.c文件,将435行 删掉
//pthread_kill_other_threads_np (); //
然后重新编译安装lib,就行了
(6) 进入/etc/ld.so.conf.d建一个minigui.conf,文件的内容为/usr/local/lib
最后要把系统共享库缓存刷新,将libminigui加载上,可以使用命令
[root@fedora7]#ldconfig
否则在运行应用程序时会报如下错:
./bomb
./bomb: error while loading shared libraries: libminigui-1.3.so.3: cannot open shared object file: No such file or directory
编译qvfb时:
(7) 错误:configure: error: C++ preprocessor "/lib/cpp" fails sanity check
原因:gcc的组件没装全
解决:apt-get install build-essential
(8) checking for X... configure: error: Can't find X includes. Please check your installation and add the correct paths!
解决: sudo apt-get install xorg-dev 或sudo apt-get install xlibs-dev
(9) 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的lib&&headers的软件包,并安装之
解决:sudo apt-get install libqt3-headers libqt3-mt-dev
最后./configure时加上如下选项:./configure --with-qt-includes=/usr/include/qt3 --with-qt-lilbraries=/usr/lib/qt3
(10) 运行./helloworld后出现
No available video device.
NEWGAL: Does not find matched engine: fbcon.
GDI: Can not get graphics engine information!
解决:修改MiniGUI.cfg内,gal_engine=qvfb,ial_engine=qvfb
***************************************************************************************************
(1)
编译mde-1.3.0出错:
/usr/local/include/minigui/filedlg.h:130: undefined reference to `OpenFileDialogEx'
/usr/local/include/minigui/filedlg.h:130: undefined reference to `OpenFileDialogEx'
具体错误如下:
source='main.c' object='main.o' libtool=no \
depfile='.deps/main.Po' tmpdepfile='.deps/main.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"mde\" -DVERSION=\"1.3.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MINIGUI_COMMON_H=1 -DHAVE_DECL__LITE_VERSION=0 -DHAVE_DECL__STAND_ALONE=0 -DHAVE_DECL__USE_NEWGAL=0 -I. -I. -g -O2 -Wall -Wstrict-prototypes -pipe -D_REENTRANT -c `test -f 'main.c' || echo './'`main.c
gcc -g -O2 -Wall -Wstrict-prototypes -pipe -D_REENTRANT -o notebook main.o -lpng -ljpeg -lpthread -lminigui
main.o: In function `OpenFileDialog':
/usr/local/include/minigui/filedlg.h:130: undefined reference to `OpenFileDialogEx'
/usr/local/include/minigui/filedlg.h:130: undefined reference to `OpenFileDialogEx'
main.o: In function `SetWindowSize':
/home/source/minigui/minigui1.3.x/mde-1.3.0/notebook/main.c:524: undefined reference to `myWinEntries'
/usr/local/lib/libminigui.so: undefined reference to `pthread_kill_other_threads_np'
collect2: ld 返回 1
make[2]: *** [notebook] 错误 1
make[2]: Leaving directory `/home/source/minigui/minigui1.3.x/mde-1.3.0/notebook'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/source/minigui/minigui1.3.x/mde-1.3.0/notebook'
make: *** [all-recursive] 错误 1
出错原因:
1.3.3版本的minigui所使用的超线程库为旧的linuxpthreads,而我使用的环境为fedora core 7.0,其使用的超线程库为较新的NPTL2.6(可以使用getconf GNU_LIBPTHREAD_VERSION命令查看),在这个新的超线程库中,pthread_kill_other_threads_np这个函数已经不能使用。
解决方法如下:
修改src/kernel/init.c文件,将435行注释掉:
//pthread_kill_other_threads_np ();
修改完后记得在libminigui-1.3.3中重新make ;make install
(2)
ttf库configure时是no,安装 libttf-dev 后变为yes ,可惜还是编译不过去,可能版本冲突,最后禁用了之。
错误:
freetype.c:47:41: error: freetype1/freetype/freetype.h: No such file or directory
freetype.c:48:40: error: freetype1/freetype/ftxkern.h: No such file or directory
freetype.c:49:41: error: freetype1/freetype/ftnameid.h: No such file or directory
freetype.c:50:40: error: freetype1/freetype/ftxcmap.h: No such file or directory
freetype.c:51:41: error: freetype1/freetype/ftxwidth.h: No such file or directory
解决
./configure -disable-ttfsupport
(3)
如果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 命令后,得以解决。