我學校專題有用到qt的視窗軟體
一般大家都知道qt 的compi 指令是
#qmake -project
#qmake
#make
就可以把執行檔做出來
但是我學校的專題是必須把放到一台機器上
而那台機器有特殊的編碼
於是他有提供source給我
然後我看到ㄊ裡面有一個部分是有關編碼的
#!/bin/sh
##############################################################################
#
# Neuros BSP Environment.
#
# Sourcing this file sets up the necessary environment to use the Neuros BSP.
#
##############################################################################
if [ -z ${IT_PATH_ORIG} ]; then
export IT_PATH_ORIG=${PATH};
fi
PROJECT=neuros-bsp
PRJROOT=/home/neuros/Desktop/neuros-osd/${PROJECT}
TOOLCHAIN=/home/neuros/Desktop/neuros-osd/neuros-bsp/toolchain
PATH=${TOOLCHAIN}/bin:${IT_PATH_ORIG}
ROOTFS=${PRJROOT}/rootfs
INSTALL_MOD_PATH=${ROOTFS}/fs
SU=sudo
MKCRAMFS=/usr/sbin/mkcramfs
TOOLCHAIN_ARCH=${TOOLCHAIN}/arm-linux
TOOLCHAIN_USR_INSTALL=${TOOLCHAIN_ARCH}/usr
NQMAKE=${TOOLCHAIN}/Qt/bin/qmake
NRCC=${TOOLCHAIN}/Qt/bin/rcc
NLRELEASE=${TOOLCHAIN}/Qt/bin/lrelease
NLUPDATE=${TOOLCHAIN}/Qt/bin/lupdate
## this specifies where extended storage space sits
## RUN_TIME_xxx:
## defines the run-time extended storage path, these
## paths are what 'code' actually sees and remain the
## same for both upk and NFS debug environment.
RUN_TIME_EXTENDED_STORAGE_PATH=media/ext/.osd-extended
RUN_TIME_EXTENDED_PROGRAMS_PATH=${RUN_TIME_EXTENDED_STORAGE_PATH}/programs
## these definitions are specifically for NFS debug purpose.
## all stuff that belongs to extended area will be actually installed
## here during compile time, however at run-time, xxx_PATH below is
## mapped to RUN_TIME_xxx_PATH defined above.
##
## HOW IT WORKS:
## - UPK builder will take the stuff in NFS_DEBUG_EXTENDED_AREA to
## create the extended part of the upk
## - at NFS debugging time, rootfs will be mounted as read-only, and
## NFS_DEBUG_EXTENDED_AREA will be mounted read-writable to where
## real extended storage locates (either external CF card or on-board
## NAND disk partition).
## - thus there is no difference between upk real world and NFS development
## environment.
NFS_DEBUG_EXTENDED_AREA=nfs-debug-extended-area
EXTENDED_STORAGE_PATH=${NFS_DEBUG_EXTENDED_AREA}/.osd-extended
EXTENDED_PROGRAMS_PATH=${EXTENDED_STORAGE_PATH}/programs
## This variables added because a change in the busybox build system
## requires these 2 env variables to be set for cross compile configuration
ARCH=arm
CROSS_COMPILE=arm-linux-
## End Busybox section.
export PROJECT PRJROOT TOOLCHAIN TOOLCHAIN_ARCH TOOLCHAIN_USR_INSTALL \
PATH SU ROOTFS INSTALL_MOD_PATH MKCRAMFS ARCH CROSS_COMPILE NQMAKE NRCC \
EXTENDED_PROGRAMS_PATH EXTENDED_STORAGE_PATH NFS_DEBUG_EXTENDED_AREA \
RUN_TIME_EXTENDED_STORAGE_PATH RUN_TIME_EXTENDED_PROGRAMS_PATH
# multi-language global configuration.
# YES: support is enabled
# NO : supporit is disabled.
# don't commit any below language change to svn,the should be default support nothing
OSD_LS_CHN=NO
OSD_LS_SPA=NO
OSD_LS_GER=NO
OSD_LS_FRE=NO
OSD_LS_JAP=NO
OSD_LS_ITA=NO
export OSD_LS_CHN OSD_LS_SPA OSD_LS_GER OSD_LS_FRE OSD_LS_JAP OSD_LS_ITA
alias nqmake=${TOOLCHAIN}/Qt/bin/qmake
alias nrcc=${TOOLCHAIN}/Qt/bin/rcc
alias nlrelease=${TOOLCHAIN}/Qt/bin/nlrelease
alias nlupdate=${TOOLCHAIN}/Qt/bin/nlupdate
alias nmake=${PRJROOT}/scripts/nmake.sh
一開始我把qt寫好的程式碼用nqmake 做 compi
但卻得到無此指令的會應
後來我發現
我在那台機器提供的source中
/neuros-bsp/toolchain目錄下裡面找不到Qt
所以我把我自己安裝的qtsdk-2009.03裡面的qt複製到
/neuros-bsp/toolchain目錄中
後來在執行nqmake 就可以執行
如下
debian:/home/neuros/test# nqmake -project
debian:/home/neuros/test# nqmake
debian:/home/neuros/test# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/qtsdk-2009.03/qt/mkspecs/linux-g++ -I. -I/opt/qtsdk-2009.03/qt/include/QtCore -I/opt/qtsdk-2009.03/qt/include/QtGui -I/opt/qtsdk-2009.03/qt/include -I. -I. -o hello.o hello.cpp
g++ -Wl,-O1 -Wl,-rpath,/opt/qtsdk-2009.03/qt/lib -o test hello.o -L/opt/qtsdk-2009.03/qt/lib -lQtGui -L/opt/qtsdk-2009.03/qt/lib -L/usr/X11R6/lib -pthread -lfreetype -lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lfontconfig -lXext -lX11 -lQtCore -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
/usr/bin/ld: cannot find -lfreetype
collect2: ld returned 1 exit status
make: *** [test] Error 1
debian:/home/neuros/test# ls
hello.cpp hello.o Makefile test.pro
但是執行到make指令時卻發現有error
我試著 apt-get install lfreetype的一些相關套件
安裝完我再從新make一次
後來這又出現
/usr/bin/ld: cannot find -lgobject-2.0
而一樣我也在裝了一些套件
但是到/usr/bin/ld: cannot find -lSM 這個error
我裝了許多套件卻還是一樣卡在這
請問我要怎樣做才能使我的程式能compi完成
這對我很重要~請大家幫幫我這個可憐新手小弟
我提供一下我在網路上看到類似那台機器編碼的做法
http://assets.en.oreilly.com/1/event/12 ... 6,1,Neuros Technology GUI Application Development with Qt4