linux平台qt新建word,ubuntu10.10建立QT开发环境图文详解

四、安装qt-embedded-x86版的qt

(1)进入siseapp目录,建立qt4.6.3_embedded_x86文件夹,用来存放解压后的该版本的qt

sise@sise:~$ cd siseapp/

sise@sise:~/siseapp$ mkdir qt4.6.3_embedded_x86

21945988_42.jpg

(2)解压qt源文件文件,制定解压后存放的目录为刚才建立的目录:

sise@sise:~/siseapp$ cd /home/sise/sisefile/qt4/

sise@sise:~/sisefile/qt4$ tar -zvxf qt-everywhere-opensource-src-4.6.3.tar.gz -C /home/sise/siseapp/qt4.6.3_embedded_x86

21945988_43.jpg

(3)配置qt的编译选项:

sise@sise:~/sisefile/qt4$ cd /home/sise/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3/

sise@sise:~/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3$ ./configure -prefix /home/sise/siseapp/qt-embedded-4.6.3-x86 -embedded x86 -qvfb

21945988_44.jpg

选择 o

21945988_45.jpg

选择yes

21945988_46.jpg

(4)编译

sise@sise:~/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3$ make

21945988_47.jpg

安装

sise@sise:~/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3$ make install

21945988_48.jpg

在qcreator中添加刚才编译的qt版本的环境变量:

21945988_49.jpg

(5)重新利用该版本的qt编译helloworld工程

打开helloworld工程:

21945988_50.jpg

选择该版本qt的环境变量

21945988_51.jpg

设置run setting

21945988_52.jpg

我们先打开qvfb

sise@sise:~/siseapp/qt4.6.3_embedded_x86/qt-everywhere-opensource-src-4.6.3$ qvfb &

21945988_53.jpg

然后编译仿真,出现以下窗口,证明我们的qt又编译成功了:

21945988_54.jpg

五、编译安装tslib:

Tslib是一个开源的程序,能够为触摸屏驱动获得的采样提供诸如滤波、去抖、校准等功能,通常作为触摸屏驱动的适配层,为上层的应用提供了一个统一的接口。(下载tslib1.4)

(1)进入tslib存放源文件的文件夹,解压tslib:

sise@sise:~$ cd sisefile/tslib1.4/

sise@sise:~/sisefile/tslib1.4$ tar -zxvf tslib-1.4.tar.gz

21945988_55.jpg

(2)注:此步需要一些工具,ubuntu下需要安装automake、autoconf、libtool,可以执行下面语句安装,sudo apt-get install automake autoconf libtool,不然的话,我们是无法执行autogen.sh脚本的:

sise@sise:~/sisefile/tslib1.4$ sudo apt-get install automake autoconf libtool

21945988_56.jpg

(3)进入解压后的tslib文件夹,执行autogen.sh脚本文件:

sise@sise:~/sisefile/tslib1.4$ cd tslib/

sise@sise:~/sisefile/tslib1.4/tslib$ ./autogen.sh

21945988_57.jpg

(4)配置tslib的选项:

sise@sise:~/sisefile/tslib1.4/tslib$ ./configure –prefix=/usr/local/tslib/ –host=arm-linux ac_cv_func_malloc_0_nonnull=yes

21945988_58.jpg

(5)编译tslib:

sise@sise:~/sisefile/tslib1.4/tslib$ make

21945988_59.jpg

(6)安装tslib:

sise@sise:~/sisefile/tslib1.4/tslib$ sudo make install

21945988_60.jpg

(7)修改ts.conf:

sise@sise:~/sisefile/tslib1.4/tslib$ sudo gedit /usr/local/tslib/etc/ts.conf

将第二行“#module_raw input”注释去掉,变为“module_raw input”,注意一定要顶格。

21945988_61.jpg

(8)以下内容是在开发板的linux系统中修改的,现在由于优龙fs2410使用的cramfs文件系统是只读的,我们无法修改,这个要等到我们做出yaffs文件系统后,才能做。

打开profile:

$vi /etc/profile

添加内容如下:

export TSLIB_ROOT=/tslib

export TSLIB_TSDEVICE=/dev/event0

export LD_LIBRARY_PATH=/tslib/lib:$LD_LIBRARY_PATH

export TSLIB_FBDEVICE=/dev/fb0

export TSLIB_PLUGINDIR=/tslib/lib/ts

export TSLIB_CONSOLEDEVICE=none

export TSLIB_CONFFILE=/tslib/etc/ts.conf

export TSLIB_CALIBFILE=/etc/pointercal

export TSLIB_TSEVENTTYPE=”H3600″

export QWS_SIZE=320*240

export QWS_MOUSE_PROTO=Tslib:/dev/event0

export QWS_DISPLAY=”LinuxFb:mmWidth50:mmHeight65:0″

export POINTERCAL_FILE=/etc/pointercal

export QWS_SW_CURSOR

export QWS_KEYBOARD=”TTY:/dev/tty1″

export set QTDIR=/opt/qt

export PATH=$QTDIR:$PATH

export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/plugins/imageformats:$LD_LIBRARY_PATH

export QT_PLUGIN_PATH=$QTDIR/plugins/

export QT_QWS_FONTDIR=$QTDIR/lib/fonts

六、安装arm版qt

(1)建立存放解压后的qt的文件夹

sise@sise:~/sisefile/tslib1.4/tslib$ cd /home/sise/siseapp/

sise@sise:~/siseapp$ mkdir qt-embedded-4.6.3-arm

sise@sise:~/siseapp$ mkdir qt_4.6.3_embedded_arm

21945988_62.jpg

(2)解压qt

sise@sise:~/siseapp$ cd /home/sise/sisefile/qt4/

sise@sise:~/sisefile/qt4$ ls

qt-everywhere-opensource-src-4.6.3.tar.gz

qt-sdk-linux-x86-opensource-2010.04.bin

sise@sise:~/sisefile/qt4$ tar -zvxf qt-everywhere-opensource-src-4.6.3.tar.gz -C /home/sise/siseapp/qt_4.6.3_embedded_arm/

21945988_63.jpg

(3)安装libjpeg-dev包

sise@sise:~/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3$ sudo apt-get install libjpeg-dev

21945988_64.jpg

(4)我们来查看一下qt有哪些可选的配置编译选项:

输入以下命令:

sise@sise:~/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3$ ./configure –help

可以看到以下的选项

Usage:  configure [-h] [-prefix

[-docdir

[-translationdir

[-demosdir

[-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]

[-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]

[-accessibility] [-no-stl] [-stl] [-no-sql-] [-sql-]

[-plugin-sql-] [-system-sqlite] [-no-qt3support] [-qt3support]

[-platform] [-D ] [-I ] [-L ] [-help]

[-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]

[-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]

[-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make ]

[-nomake ] [-R ]  [-l ] [-no-rpath]  [-rpath] [-continue]

[-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]

[-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked]

[-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]

[-qtnamespace ] [-qtlibinfix ] [-separate-debug-info] [-armfpa]

[-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns]

[-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]

[-no-audio-backend] [-audio-backend] [-no-openssl] [-openssl] [-openssl-linked]

[-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit]

[-no-script] [-script] [-no-scripttools] [-scripttools] [-no-declarative] [-declarative]

[additional platform specific options (see below)]

Installation options:

These are optional, but you may specify install directories.

-prefix

(default /usr/local/Trolltech/Qt-4.6.3)

* -prefix-install …. Force a sandboxed “local” installation of

Qt. This will install into

/usr/local/Trolltech/Qt-4.6.3, if this option is

disabled then some platforms will attempt a

“system” install by placing default values to

be placed in a system location other than

PREFIX.

You may use these to separate different parts of the install:

-bindir

(default PREFIX/bin)

-libdir

(default PREFIX/lib)

-docdir

(default PREFIX/doc)

-headerdir

(default PREFIX/include)

-plugindir

(default PREFIX/plugins)

-datadir

(default PREFIX)

-translationdir

(default PREFIX/translations)

-sysconfdir

(default PREFIX/etc/settings)

-examplesdir

(default PREFIX/examples)

-demosdir

(default PREFIX/demos)

You may use these options to turn on strict plugin loading.

-buildkey …. Build the Qt library and plugins using the specified

.  When the library loads plugins, it will only

load those that have a matching key.

Configure options:

The defaults (*) are usually acceptable. A plus (+) denotes a default value

that needs to be evaluated. If the evaluation succeeds, the feature is

included. Here is a short explanation of each option:

*  -release ……….. Compile and link Qt with debugging turned off.

-debug …………. Compile and link Qt with debugging turned on.

-debug-and-release . Compile and link two versions of Qt, with and without

debugging turned on (Mac only).

-developer-build … Compile and link Qt with Qt developer options (including auto-tests exporting)

-opensource …….. Compile and link the Open-Source Edition of Qt.

-commercial …….. Compile and link the Commercial Edition of Qt.

*  -shared ………… Create and use shared Qt libraries.

-static ………… Create and use static Qt libraries.

*  -no-fast ……….. Configure Qt normally by generating Makefiles for all

project files.

-fast ………….. Configure Qt quickly by generating Makefiles only for

library and subdirectory targets.  All other Makefiles

are created as wrappers, which will in turn run qmake.

-no-largefile …… Disables large file support.

+  -largefile ……… Enables Qt to access files larger than 4 GB.

-no-exceptions ….. Disable exceptions on compilers that support it.

*  -exceptions …….. Enable exceptions on compilers that support it.

-no-accessibility .. Do not compile Accessibility support.

*  -accessibility ….. Compile Accessibility support.

-no-stl ………… Do not compile STL support.

*  -stl …………… Compile STL support.

-no-sql- … Disable SQL entirely.

-qt-sql- … Enable a SQL in the QtSql library, by default

none are turned on.

-plugin-sql- Enable SQL as a plugin to be linked to

at run time.

Possible values for :

[  db2 ibase mysql oci odbc psql sqlite sqlite2 sqlite_symbian tds ]

-system-sqlite ….. Use sqlite from the operating system.

-no-qt3support ….. Disables the Qt 3 support functionality.

*  -qt3support …….. Enables the Qt 3 support functionality.

-no-xmlpatterns …. Do not build the QtXmlPatterns module.

+  -xmlpatterns ……. Build the QtXmlPatterns module.

QtXmlPatterns is built if a decent C++ compiler

is used and exceptions are enabled.

-no-multimedia ….. Do not build the QtMultimedia module.

+  -multimedia …….. Build the QtMultimedia module.

-no-audio-backend .. Do not build the platform audio backend into QtMultimedia.

+  -audio-backend ….. Build the platform audio backend into QtMultimedia if available.

-no-phonon ……… Do not build the Phonon module.

+  -phonon ………… Build the Phonon module.

Phonon is built if a decent C++ compiler is used.

-no-phonon-backend.. Do not build the platform phonon plugin.

+  -phonon-backend….. Build the platform phonon plugin.

-no-svg ………… Do not build the SVG module.

+  -svg …………… Build the SVG module.

-no-webkit ……… Do not build the WebKit module.

+  -webkit ………… Build the WebKit module.

WebKit is built if a decent C++ compiler is used.

-no-javascript-jit . Do not build the JavaScriptCore JIT compiler.

+  -javascript-jit …. Build the JavaScriptCore JIT compiler.

-no-script ……… Do not build the QtScript module.

+  -script ………… Build the QtScript module.

-no-scripttools …. Do not build the QtScriptTools module.

+  -scripttools ……. Build the QtScriptTools module.

+  -no-declarative …..Do not build the declarative module.

-declarative ……. Build the declarative module.

-platform target … The operating system and compiler you are building

on (linux-g++).

See the README file for a list of supported

operating systems and compilers.

-graphicssystem Sets an alternate graphics system. Available options are:

raster – Software rasterizer

opengl – Rendering via OpenGL, Experimental!

-no-mmx ………… Do not compile with use of MMX instructions.

-no-3dnow ………. Do not compile with use of 3DNOW instructions.

-no-sse ………… Do not compile with use of SSE instructions.

-no-sse2 ……….. Do not compile with use of SSE2 instructions.

-qtnamespace   Wraps all Qt library code in ‘namespace {…}’.

-qtlibinfix   Renames all libQt*.so to libQt*.so.

-D …….. Add an explicit define to the preprocessor.

-I …….. Add an explicit include path.

-L …….. Add an explicit library path.

-help, -h ………. Display this information.

Third Party Libraries:

-qt-zlib ……….. Use the zlib bundled with Qt.

+  -system-zlib ……. Use zlib from the operating system.

See http://www.gzip.org/zlib

-no-gif ………… Do not compile the plugin for GIF reading support.

*  -qt-gif ………… Compile the plugin for GIF reading support.

See also src/plugins/imageformats/gif/qgifhandler.h

-no-libtiff …….. Do not compile the plugin for TIFF support.

-qt-libtiff …….. Use the libtiff bundled with Qt.

+  -system-libtiff …. Use libtiff from the operating system.

See http://www.libtiff.org

-no-libpng ……… Do not compile in PNG support.

-qt-libpng ……… Use the libpng bundled with Qt.

+  -system-libpng ….. Use libpng from the operating system.

See http://www.libpng.org/pub/png

-no-libmng ……… Do not compile the plugin for MNG support.

-qt-libmng ……… Use the libmng bundled with Qt.

+  -system-libmng ….. Use libmng from the operating system.

See http://www.libmng.com

-no-libjpeg …….. Do not compile the plugin for JPEG support.

-qt-libjpeg …….. Use the libjpeg bundled with Qt.

+  -system-libjpeg …. Use libjpeg from the operating system.

See http://www.ijg.org

-no-openssl …….. Do not compile support for OpenSSL.

+  -openssl ……….. Enable run-time OpenSSL support.

-openssl-linked …. Enabled linked OpenSSL support.

-ptmalloc ………. Override the system memory allocator with ptmalloc.

(Experimental.)

Additional options:

-make ……. Add part to the list of parts to be built at make time.

(libs tools examples demos docs translations)

-nomake ….. Exclude part from the list of parts to be built.

-R …….. Add an explicit runtime library path to the Qt

libraries.

-l …….. Add an explicit library.

-no-rpath ………. Do not use the library install path as a runtime

library path.

+  -rpath …………. Link Qt libraries and executables using the library

install path as a runtime library path. Equivalent

to -R install_libpath

-continue ………. Continue as far as possible if an error occurs.

-verbose, -v ……. Print verbose information about each step of the

configure process.

-silent ………… Reduce the build output so that warnings and errors

can be seen more easily.

*  -no-optimized-qmake … Do not build qmake optimized.

-optimized-qmake …… Build qmake optimized.

-no-nis ………… Do not compile NIS support.

*  -nis …………… Compile NIS support.

-no-cups ……….. Do not compile CUPS support.

*  -cups ………….. Compile CUPS support.

Requires cups/cups.h and libcups.so.2.

-no-iconv ………. Do not compile support for iconv(3).

*  -iconv …………. Compile support for iconv(3).

-no-pch ………… Do not use precompiled header support.

*  -pch …………… Use precompiled header support.

-no-dbus ……….. Do not compile the QtDBus module.

+  -dbus ………….. Compile the QtDBus module and dynamically load libdbus-1.

-dbus-linked ……. Compile the QtDBus module and link to libdbus-1.

-reduce-relocations ….. Reduce relocations in the libraries through extra

linker optimizations (Qt/X11 and Qt for Embedded Linux only;

experimental; needs GNU ld >= 2.18).

-no-separate-debug-info . Do not store debug information in a separate file.

*  -separate-debug-info …. Strip debug information into a separate .debug file.

Qt/X11 only:

-no-gtkstyle ……. Do not build the GTK theme integration.

+  -gtkstyle ………. Build the GTK theme integration.

*  -no-nas-sound …… Do not compile in NAS sound support.

-system-nas-sound .. Use NAS libaudio from the operating system.

See http://radscan.com/nas.html

-no-opengl ……… Do not support OpenGL.

+  -opengl …… Enable OpenGL support.

With no parameter, this will auto-detect the “best”

OpenGL API to use. If desktop OpenGL is available, it

will be used. Use desktop, es1, es1cl or es2 for

to force the use of the Desktop (OpenGL 1.x or 2.x),

OpenGL ES 1.x Common profile, 1.x Common Lite profile

or 2.x APIs instead. On X11, the EGL API will be used

to manage GL contexts in the case of OpenGL ES

-no-openvg …….. Do not support OpenVG.

+   -openvg ……….. Enable OpenVG support.

Requires EGL support, typically supplied by an OpenGL

or other graphics implementation.

-no-sm …………. Do not support X Session Management.

*  -sm ……………. Support X Session Management, links in -lSM -lICE.

-no-xshape ……… Do not compile XShape support.

*  -xshape ………… Compile XShape support.

Requires X11/extensions/shape.h.

-no-xsync ………. Do not compile XSync support.

*  -xsync …………. Compile XSync support.

Requires X11/extensions/sync.h.

-no-xinerama ……. Do not compile Xinerama (multihead) support.

*  -xinerama ………. Compile Xinerama support.

Requires X11/extensions/Xinerama.h and libXinerama.

By default, Xinerama support will be compiled if

available and the shared libraries are dynamically

loaded at runtime.

-no-xcursor …….. Do not compile Xcursor support.

*  -xcursor ……….. Compile Xcursor support.

Requires X11/Xcursor/Xcursor.h and libXcursor.

By default, Xcursor support will be compiled if

available and the shared libraries are dynamically

loaded at runtime.

-no-xfixes ……… Do not compile Xfixes support.

*  -xfixes ………… Compile Xfixes support.

Requires X11/extensions/Xfixes.h and libXfixes.

By default, Xfixes support will be compiled if

available and the shared libraries are dynamically

loaded at runtime.

-no-xrandr ……… Do not compile Xrandr (resize and rotate) support.

*  -xrandr ………… Compile Xrandr support.

Requires X11/extensions/Xrandr.h and libXrandr.

-no-xrender …….. Do not compile Xrender support.

*  -xrender ……….. Compile Xrender support.

Requires X11/extensions/Xrender.h and libXrender.

-no-mitshm ……… Do not compile MIT-SHM support.

*  -mitshm ………… Compile MIT-SHM support.

Requires sys/ipc.h, sys/shm.h and X11/extensions/XShm.h

-no-fontconfig ….. Do not compile FontConfig (anti-aliased font) support.

*  -fontconfig …….. Compile FontConfig support.

Requires fontconfig/fontconfig.h, libfontconfig,

freetype.h and libfreetype.

-no-xinput ……… Do not compile Xinput support.

*  -xinput ………… Compile Xinput support. This also enabled tablet support

which requires IRIX with wacom.h and libXi or

XFree86 with X11/extensions/XInput.h and libXi.

-no-xkb ………… Do not compile XKB (X KeyBoard extension) support.

*  -xkb …………… Compile XKB support.

-no-glib ……….. Do not compile Glib support.

+  -glib ………….. Compile Glib support.

我们现在就选择要qt的编译配置,这是我选的配置,具体的作用大家可以查看上述的选项:

sise@sise:~/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3$ ./configure -prefix /usr/local/Trolltech/QtEmbedded-4.6.3-arm -opensource -confirm-license -release -shared -embedded arm -xplatform qws/linux-arm-g++ -depths 16,18,24 -fast -optimized-qmake -pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -little-endian -host-little-endian -no-qt3support -no-libtiff -no-libmng -no-opengl -no-mmx -no-sse -no-sse2 -no-3dnow -no-openssl -no-qvfb -no-nis -no-opengl -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -nomake examples -nomake tools -nomake docs -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib

21945988_65.jpg

这里要注意的是,-qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib这句很重要的,这是让QT支持触摸屏,而且要使用到我们刚才编译过的tslib。

配置完成后,开始编译:

sise@sise:~/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3$ make

21945988_66.jpg

以下出现的错误是因为我使用了arm-linux-gcc 3.3.2,而qt4.6.3是需要arm-linux-gcc 4版本以上的,否则会出现语法错误。

arm-linux-g++: 语言 c++-header 未能被识别

arm-linux-g++: global/qt_pch.h:未使用链接器输入文件,因为链接尚未完成

arm-linux-g++ -c -include .pch/release-shared-emb-arm/QtCore -pipe -I/usr/local/tslib/include -fno-exceptions -O2 -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DELF_INTERPRETER=\”/lib/ld-linux.so.2\” -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-arm-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared-emb-arm -o .obj/release-shared-emb-arm/qabstractanimation.o animation/qabstractanimation.cpp

:156497025:62664: .pch/release-shared-emb-arm/QtCore:没有那个文件或目录

make[1]: *** [.obj/release-shared-emb-arm/qabstractanimation.o] 错误 1

make[1]:正在离开目录 `/home/sise/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3/src/corelib’

make: *** [sub-corelib-make_default-ordered] 错误 2

解决:

-pch 改成 -no-pch

sise@sise:~/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3$ ./configure -prefix /usr/local/Trolltech/QtEmbedded-4.6.3-arm -opensource -confirm-license -release -shared -embedded arm -xplatform qws/linux-arm-g++ -depths 16,18,24 -fast -optimized-qmake -pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -little-endian -host-little-endian -no-qt3support -no-libtiff -no-libmng -no-opengl -no-mmx -no-sse -no-sse2 -no-3dnow -no-openssl -no-qvfb -no-nis -no-opengl -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -nomake examples -nomake tools -nomake docs -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib

21945988_67.jpg

statemachine/qstatemachine.cpp: In constructor `

QStateMachinePrivate::QStateMachinePrivate()’:

statemachine/qstatemachine.cpp:181: 错误: invalid pointer to bit-field `

QAbstractStatePrivate::isMachine’

make[1]: *** [.obj/release-shared-emb-arm/qstatemachine.o] 错误 1

make[1]:正在离开目录 `/home/sise/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3/src/corelib’

make: *** [sub-corelib-make_default-ordered] 错误 2

解决:

注释QAbstractStatePrivate::isMachine

sise@sise:~/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3$ gedit mkspecs/qws/linux-arm-g++/qmake.conf

QMAKE_LINK              = arm-linux-g++

QMAKE_LINK_SHLIB        = arm-linux-g++

QMAKE_LINK              = arm-linux-g++ -lts

QMAKE_LINK_SHLIB        = arm-linux-g++ -lts

text/qfontengine_ft.cpp: In member function `bool

QFontEngineFT::init(QFontEngine::FaceId, bool, QFontEngineFT::GlyphFormat)’:

text/qfontengine_ft.cpp:696: 警告: initialization to `int’ from `qreal’

text/qfontengine_ft.cpp:696: 警告: argument to `int’ from `qreal’

{standard input}: Assembler messages:

{standard input}:1599: Error: register or shift expression expected — `orr r3,r2,lsl#16′

{standard input}:1609: Error: register or shift expression expected — `orr r2,r3,lsl#16′

{standard input}:3151: Error: register or shift expression expected — `orr r2,r0,lsl#16′

{standard input}:3161: Error: register or shift expression expected — `orr r1,r0,lsl#16′

make[1]: *** [.obj/release-shared-emb-arm/qfontengine_ft.o] 错误 1

make[1]:正在离开目录 `/home/sise/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3/src/gui’

make: *** [sub-gui-make_default-ordered] 错误 2

解决:参考http://www.qtcn.org/bbs/read.php?tid=24692&fpage=0&toread=&page=1  守望者的临时解决方案:

To fix this issue patch /src/3rdparty/freetype/include/freetype/config/ftconfig.h Line 330.

(原来的为)  “orr %0, %2, lsl #16\n\t” /* %0 |= %2 << 16 */

(修改后为)  “orr %0, %0, %2, lsl #16\n\t” /* %0 |= %2 << 16 */

//     change this line

//    “orr    %0, %2, lsl #16\n\t”  /* %0 |= %2 << 16 */

“orr    %0, %0,%2, lsl #16\n\t”  /* %0 |= %2 << 16 */

itemviews/qlistview.cpp

itemviews/qlistview.cpp: In member function `void

QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo&)’:

itemviews/qlistview.cpp:2824: 错误: type specifier omitted for parameter `

topLeft’

itemviews/qlistview.cpp:2886: 错误: no match for ‘operator|=’ in ‘

rect(QPoint (*)()) |= QListViewItem::rect() const()’

itemviews/qlistview.cpp:2888: 错误: no match for ‘operator|=’ in ‘

rect(QPoint (*)()) |= QRect(flowPosition, segPosition, deltaFlowPosition,

deltaSegPosition)’

itemviews/qlistview.cpp:2890: 错误: no match for ‘operator|=’ in ‘

rect(QPoint (*)()) |= QRect(segPosition, flowPosition, deltaSegPosition,

deltaFlowPosition)’

itemviews/qlistview.cpp:2901: 错误: request for member `width’ in `

rect(QPoint (*)())’, which is of non-aggregate type `QRect ()(QPoint (*)())’

itemviews/qlistview.cpp:2901: 错误: request for member `height’ in `

rect(QPoint (*)())’, which is of non-aggregate type `QRect ()(QPoint (*)())’

itemviews/qlistview.cpp:2905: 错误: request for member `size’ in `

rect(QPoint (*)())’, which is of non-aggregate type `QRect ()(QPoint (*)())’

itemviews/qlistview.cpp:2912: 错误: request for member `bottomRight’ in `

rect(QPoint (*)())’, which is of non-aggregate type `QRect ()(QPoint (*)())’

make[1]: *** [.obj/release-shared-emb-arm/qlistview.o] 错误 1

make[1]:正在离开目录 `/home/sise/siseapp/qt_4.6.3_embedded_arm/qt-everywhere-opensource-src-4.6.3/src/gui’

make: *** [sub-gui-make_default-ordered] 错误 2

解决:

//               rect |= QRect(flowPosition, segPosition, deltaFlowPosition, deltaSegPosition);

rect = rect | QRect(flowPosition, segPosition, deltaFlowPosition, deltaSegPosition);

2890

else // flow == TopToBottom

//               rect |= QRect(segPosition, flowPosition, deltaSegPosition, deltaFlowPosition);

rect = rect | QRect(segPosition, flowPosition, deltaSegPosition, deltaFlowPosition);

不过修改后虽然可以编译通过,但是还是出现了更多的语法错误。这让我发现出现这些问题是不正常的。因为不同版本的gcc对语法检查的要求是不一样的,所以我直接换用了arm-linux-gcc 4.1.2,编译不会出现以上的错误。

编译完成后,安装,在qcreator中建立该版本的qt环境变量。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值