1. 程式人生 > >miniGUI移植到ubuntu12.04(64位)問題總結

miniGUI移植到ubuntu12.04(64位)問題總結

1、安裝libpng-1.2.37,執行make錯誤資訊,在安裝目錄下沒有建立libpng
網址:https://bbs.csdn.net/topics/390844865

[[email protected] libpng-1.2.31]# make
make all-am
make[1]: Entering directory /lamp/libpng-1.2.31' /bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -no-undefined -export-dynamic -version-number 0:31:0 -Wl,--version-script=libpng.vers -o libpng12.la -rpath /usr/local/libpng/lib libpng12_la-png.lo libpng12_la-pngset.lo libpng12_la-pngget.lo libpng12_la-pngrutil.lo libpng12_la-pngtrans.lo libpng12_la-pngwutil.lo libpng12_la-pngread.lo libpng12_la-pngrio.lo libpng12_la-pngwio.lo libpng12_la-pngwrite.lo libpng12_la-pngrtran.lo libpng12_la-pngwtran.lo libpng12_la-pngmem.lo libpng12_la-pngerror.lo libpng12_la-pngpread.lo -lz -lm libtool: link: gcc -shared .libs/libpng12_la-png.o .libs/libpng12_la-pngset.o .libs/libpng12_la-pngget.o .libs/libpng12_la-pngrutil.o .libs/libpng12_la-pngtrans.o .libs/libpng12_la-pngwutil.o .libs/libpng12_la-pngread.o .libs/libpng12_la-pngrio.o .libs/libpng12_la-pngwio.o .libs/libpng12_la-pngwrite.o .libs/libpng12_la-pngrtran.o .libs/libpng12_la-pngwtran.o .libs/libpng12_la-pngmem.o .libs/libpng12_la-pngerror.o .libs/libpng12_la-pngpread.o -lz -lm -Wl,--version-script=libpng.vers -Wl,-soname -Wl,libpng12.so.0 -o .libs/libpng12.so.0.31.0 /usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against

.rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libpng12.la] Error 1
make[1]: Leaving directory `/lamp/libpng-1.2.31’
make: *** [all] Error 2

解決辦法:cd zlib-1.2.3 //進入zlib目錄

make clean

CFLAGS="-O3 -fPIC" ./configure //使用64位元的方法進行編譯

make

make install

2、
(1)安裝qvfb2-2.0,出現checking for X… configure: error: Can’t find X includes. Please check your installation and add the correct paths!
解決辦法:安裝qt3-dev-tools-embedded , libqt3-headers and libqt3-mt-dev
sudo apt-get install qt3-dev-tools-embedded

sudo apt-get install libqt3-headers libqt3-mt-dev

(2)checking for Qt… configure: error: Qt (>= Qt 3.0.3) (headers and libraries) not found. Please check your installation!
解決辦法:
sudo vim /etc/apt/sources.list 新增包含libqt3的庫,

deb http://cz.archive.ubuntu.com/ubuntu precise main

新增完後

sudo apt-get update 更新庫

這時

安裝 sudo apt-get install libqt3-mt 庫,提示依賴庫沒有被包含

sudo apt-get -f install 包含依賴的庫

sudo apt-get install libqt3-mt
sudo apt-get install libqt3-mt-dev
安裝完畢

(3)make qvfb2-2.0出現/usr/share/qt3/include/qpointarray.h:59: instantiated from here
/usr/share/qt3/include/qmemarray.h:62: warning: conversion to ‘int’ from ‘long unsigned int’ may alter its value
make[2]: *** [qvfbview.o] Error 1
make[2]: Leaving directory /home/yun/miniGUISour/qvfb2-2.0/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/yun/miniGUISour/qvfb2-2.0’
make: *** [all] Error 2
解決辦法:修改 vim qvfb2-2.0/src/qvfbview.cpp第452行
把 if ( (int)data == 1 )
qFatal( “Cannot attach to shared memory” );
改為
if ( (long)data == 1 )
qFatal( “Cannot attach to shared memory” );

3、當所有都安裝完成後,在mg-samples-3.0.12/src# ./helloworld出現
start-qvfb :/usr/local/bin/gvfb pcxvfb 22164 XVFB-for-MiniGUI-3.0-(Gtk-Version) 800x600-16bpp
execlp error!!
execl: No such file or directory
NEWGAL>PCXVFB: Wait too long for CLIENT.
NEWGAL: Does not find matched engine: pc_xvfb.
KERNEL>InitGUI: Can not get graphics engine information!

解決辦法:vim /usr/local/etc/MiniGUI.cfg ,

其中一句話修改成exec_file = /usr/local/bin/qvfb2

3、[email protected]:/home/yun/miniGUISour/mg-samples-3.0.12/src$ ./helloworld
問題:
./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=/home/yun/minigui/lib_x86/lib:$LD_LIBRARY_PATH