qtopia2.2.0编译成功,分享一下经验
经过一段漫长而痛苦的过程(几次差点就要放弃)之后,今天 qtopia 2.2.0pc版本和 ARM - LINUX 版本都终于 编译 成功 了,下面我和大家分享一下pc机版本的qtopia2.2.0编译过程中的遇到的错误及其 解决 办法,希望与大家一起进步。(arm-linux版本的编译参照
经过一段漫长而痛苦的过程(几次差点就要放弃)之后,今天qtopia2.2.0pc版本和ARM-LINUX版本都终于编译成功了,下面我和大家分享一下pc机版本的qtopia2.2.0编译过程中的遇到的错误及其解决办法,希望与大家一起进步。(arm-linux版本的编译参照飞凌提供的6410的qt移植视频中的五和六,先编译第三方库,按照视频上来就没有问题,编译完第三方库以后,剩下的就和pc版本的相差无几了)
环境:ubuntu10.10
编译器: gcc version 4.4.5
主机:奔四
内存:512+256M
VMware版本:7.0
注意事项:
在编译之前先确保你的ubuntu系统中有X11的SDK库,Qtopia编译过程中需要使用X11SDK里面的一些头文件,使用以下命令,即可完成安装:
apt-get install libx11-dev libxext-dev libxtst-dev
另外,在修改完第一处错误,重新编译之前,先修改一下build脚本文件,因为重新执行build命令,该脚本会把刚才编译中的qtopia-free-2.2.0文件夹删除,重新解压,形成新的qtopia-free-2.2.0,开始编译,这样刚才的修改就失去意义了。修改build脚本的方法如下:
将 rm -fr qtopia-free-2.2.0
tar xfvz qtopia-free-2.2.0.tar.gz 这两条语句的前面分别加上# ,注释掉,保存退出,重新执行 ./build
在编译过程中会出现很多的错误,包括飞凌提供的ok6410 QT移植百科全书里面的,但是手册里面罗列的不全,下面我将我在编译过程实际遇到的编译错误及其解决办法写一下(其中的一些错误实际中没有遇到,是从网上搜集的,供朋友们参考):
错误一:
/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
错误二:
Creating pngscale...make[1]: Entering directory `/root/yizhi/qtopia-free-2.2.0/qtopia/util/pngscale'
..make[1]: *** [../../bin/pngscale] Error 1
make[1]: Leaving directory `/root/yizhi/qtopia-free-2.2.0/qtopia/util/pngscale'
Failed to make pngscale
分析:
这是因为没有安装uuid和Xmu,因为在编译qtopia2.2.0的过程中需要安装工具uuid(Universally Unique Identifier,)和 xmu库文件。
解决办法:
apt-get install uuid-dev
apt-get install libxmu-dev libxmu6
错误三:
external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o] Error 1
解决:
在ubuntu里,zlib叫zlib1g,相应的zlib-devel叫zlib1g.dev
sudo apt-get install zlib1g-dev
错误四:
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1
解决方法:
sudo apt-get install lib32z1-dev
错误五:
bison -d -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127
解决方法:
sudo apt-get install bison
错误六:
Lex: aidl /bin/bash: flex: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127
解决方法:
sudo apt-get install flex
错误七:
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1
解决方法:
sudo apt-get install lib32ncurses5-dev
错误八:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/android/main-common.o] Error 1
解决方法:
sudo apt-get install libx11-dev
错误九:
sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 96.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h] Error 25
make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h'
解决方法:
sudo apt-get install gperf
错误十:open函数参数不够
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
解决办法:
参见ok6410移植百科全书。
错误十一:使用未定义的类
error: ‘QWSInputMethod’ has not been declared
解决办法:
参见ok6410移植百科全书。 (注: 该文件中使用了这两个类,C++允许在文件中这样声明其他地方定义的类,减少头文件的相互包含关系,加快编译速度)
错误十二:缺少头文件
asm/page.h: No such file or directory
解决办法:
参见ok6410移植百科全书。
错误十三:类型转换错误
home/work/armqt/qtlibsource/qt-x11/include/qvalue stack.h: In member function 'T QValueStack
xml/qxml.cpp:513: instantiated from here
/home/work/armqt/qtlibsource/qt-x11/include/qvalue stack.h:57: 错误:不能从'QValueListIterator
/home/work/armqt/qtlibsource/qt-x11/include/qvalue stack.h: In member function 'T QValueStack
xml/qxml.cpp:2502: instantiated from here
/home/work/armqt/qtlibsource/qt-x11/include/qvalue stack.h:57: 错误:不能从'QValueListIterator
解决办法:
参见ok6410移植百科全书。
错误十四:没有找到uic工具 错误提示:
make[5]: /root/yizhi/host/qtopia-free-2.2.0/qt2/bin/uic: Command not found
make[5]: *** [../../../include/qtopia/private/passwordbase_p.h] Error 127
解决办法:
cd到你的qtopia-free-2.2.0目录下, find ./ -name uic 会看到其他的目录下已经有了uic,我把qt3/bin 目录下的uic拷贝到 qt2/bin下面,即可
(注:我在实际操作过程中,一开始报出这个错误,但是将其他的错误改完之后,这个错误也就自动消失了,我是菜鸟,不知道怎么回事, )
错误十五: 指针类型转换出错:
backend/vobject.cpp: In function ‘VObject* addGroup(VObject*, const char*)’:
backend/vobject.cpp:419: error: invalid conversion from ‘const char*’ to ‘char*’
backend/vobject.cpp: In function ‘void writeEncString(OFi
解决办法:
修改 qtopia-free-2.2.0/qtopia/src/libraries/qtopia/backend/vobject.cpp 文件419行
char *dot = strrchr(g,'.'); 修改为 char *dot = (char *)strrchr(g,'.');
在编译过程中还出现了类似的错误
wavplugin.cpp:435 : error: invalid conversion from 'const char*' to 'char*'
解决办法
修改qtopia-free-2.2.0/qtopia/src/plugins/codes/wavplugin/wavplugin.cpp文件的第435行
修改方法如上
错误十六:编译器找不到QSizePolicy类的五个参数的构造函数
ui/release-shared/passwordbase_p.cpp:35: error: no matching function for call to ‘QSizePolicy:SizePolicy(QSizePolicy::SizeType, QSizePolicy::SizeType, int, int, bool)’
/root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:93: note: candidates are: QSizePolicy:SizePolicy(int)
/root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:99: note: QSizePolicy:SizePolicy(QSizePolicy::SizeType, QSizePolicy::SizeType, bool)
/root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:63: note: QSizePolicy:SizePolicy()
/root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:46: note: QSizePolicy:SizePolicy(const QSizePolicy & )
解决办法:
qtopia-free-2.2.0/qtopia/src/libraries/qtopia/.ui/release-shared/passwordbase_p.cpp 文件中的38行位置
prompt = new QLabel( this, "prompt" );
prompt->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, prompt->sizePolicy().hasHeightForWidth() ) );
修改为:
prompt = new QLabel( this, "prompt" );
prompt->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, prompt->sizePolicy ().hasHeightForWidth() ) );
即去掉0,0 两个参数
错误十七(这是一大类错误,在编译过程中会遇到很多):g++编译器提示 有多余的符号在成员函数前 ,有些编译器规定C++成员函数前不需要再加这个类的名字
thumbnailview_p.h: At global scope:
thumbnailview_p.h:81: error: extra qualification ‘ThumbnailItem::’ on member ‘paintItem’
make[5]: *** [.obj/release-shared/imageselector.o] Eopia/src
解决办法 :
qtopia-free-2.2.0/qtopia/src/libraries/qtopia2/thumbnailview_p.h文件中第81行:
修改 void ThumbnailItem::paintItem( QPainter*, const QColorGroup& );
修改后 void paintItem( QPainter*, const QColorGroup& );
** 继续编译后会出现类似的错误
abtable_p.h:276: error: extra qualification ‘PhoneTypeSelector::’ on member ‘addType’
make[5]: *** [.obj/release-shared/abtable.o] Error 1
make[5]: Leaving directory `/root/yizhi/host/qtopia-free-2.2.0/qtopia/src/libraries/qtopiapim'
make[4]: *** [all] Error 2
解决办法:去掉 PhoneTypeSelector::
继续编译:
../../../include/qtopia/pim/private/../../../../src/libraries/qtopiapim/numberentry_p.h: At global scope:
../../../include/qtopia/pim/private/../../../../src/libraries/qtopiapim/numberentry_p.h:106: error: extra qualification ‘NumberEntryDialog::’ on member ‘eventFilter’
make[5]: *** [.obj/release-shared/numberentry.o] Error 1
make[5]: Leaving directory `/root/yizhi/host/qtopia-free-2.2.0/qtopia/src/libraries/qtopiapim'
make[4]: *** [all] Error 2
解决办法:去掉NumberEntryDialog::’
继续编译
In file included from addressbook.cpp:40:
ablabel.h: At global scope:
ablabel.h:78: error: extra qualification ‘AbLabel::’ on member ‘decodeHref"
解决办法:去掉‘AbLabel::’
继续编译
In file include from minefiled.cpp:35
minefiled.h:105: error: extra qualification 'MineFiled::' on member
'setState'
minefiled.h:106: error: extra qualification 'MineFiled::' on member
'placeMines'
解决办法:
编辑 qtopia-free-2.2.0/qtopia/src/games/minesweep/minefiled.h
修改106行和105行: 删除'MineFiled::'即可
继续编译
buttoneditordialog.h:56 error:extra qualification 'ButtonEditorDialog::' on member
'actionFor'
解决办法:
编辑qtopia-free-2.2.0/qtopia/src/settings/buttoneditor/buttoneditordialog.h
将'ButtonEditorDialog::' 删除即可
继续编译
出现packagewizard.h:106:error: extra qualification 'PackageWizard::' on member
'current'
解决办法
编辑qtopia-free-2.2.0/qtopia/src/settings/qipkg/packagewizard.h
将'PackageWizard::'删除即可
继续编译
出现 keboard.h:60 error:extra qualification 'KeboardPicks::' on member
'KeboardPicks'
解决办法
编辑qtopia-free-2.2.0/qtopia/src/plugins/inputmethods/keyboard/keyboard.h
将第60行的'KeboardPicks::'删除即可
继续编译
还会出现类似的错误,如extra qualification 'PolishedDecoration::' 、'IMToolButton::'
错误十八:未经定义的构造函数错误提示
.ui/release-shared/emaildlg.cpp: In constructor ‘EmailDialogBase::EmailDialogBase(QWidget*, const char*, bool, uint)’:
.ui/release-shared/emaildlg.cpp:65: error: no matching function for call to ‘QSizePolicy:SizePolicy(QSizePolicy::SizeType, QSizePolicy::SizeType, int, int, bool)’
/root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:93: note: candidates are: QSizePolicy:SizePolizePolicj4
修改 qtopia-free-2.2.0/qtopia/src/applications/addressbook/.ui/release-shared/emaildlg.cpp 文件第65行
okButton = new QPushButton( this, "okButton" );
okButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, okButton->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( okButton );
cancelButton = new QPushButton( this, "cancelButton" );
cancelButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, cancelButton->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( cancelButton );
修改为
okButton = new QPushButton( this, "okButton" );
okButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0,okButton->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( okButton );
cancelButton = new QPushButton( this, "cancelButton" );
cancelButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0,cancelButton->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( cancelButton );
继续编译:
错误提示:.ui/release-shared/camerabase.cpp:41: error: no matching function for call to ‘QSizePolicy:SizePolicy(QSizePolicy::SizeType, QSizePolicy::SizeType, int, int, bool)’
/root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:93: note: candidates are: QSizePolicy:SizePolicy(int)
解决办法:
编辑 qtopia-free-2.2.0/qtopia/src/applications/camera/.ui/release-shared/camerabase.cpp 文件的第41行
videocaptureview->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, videocaptureview->sizePolicy().hasHeightForWidth() ) );
修改为:
videocaptureview->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, videocaptureview->sizePolicy().hasHeightForWidth() ) );
下面将网上搜集的另外一点资料贴上:
1. Could not find wxWidgets library.
Solution: $sudo apt-get install libwxgtk2.8-0 libwxgtk2.8-dev wx2.8-headers wx-common
2. Need libsmbclient.h for compiling on Unix.
Solution: $sudo apt-get install libsmbclient-dev
3. Need cups.h for compiling on Unix.
Solution: $sudo apt-get install libcupsys2-dev
4. error: Need opensc/opensc.h.
Solution: $sudo apt-get install libopensc2-dev
5. exec: g++: not found.
Solution: $sudo apt-get install build-essential
6. error: X11/Xlib.h: no such file or directory.
Solution: $sudo apt-get install libx11-dev
7. error: X11/Xmu/WinUtil.h: no such file or directory.
Solution: $sudo apt-get install libxmu-dev
8. error: jpeglib.h: no such file or directory.
Solution: $sudo apt-get install libjpeg-dev
9. error: png.h: no such file or directory.
Solution: $sudo apt-get install libpng-dev
大体上能够遇到的错误差不多就这几种类型,关键是哪里出错去哪里找,然后进入那个路径,修改相应的错误,希望类似我这样的初学者朋友戒浮忌躁,相信大家都会成功的。

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

热门话题

夸克网盘和百度网盘都是很便利的存储工具,不少的用户们都在询问这两款软件互通吗?夸克网盘怎么分享到百度网盘?下面就让本站来为用户们来仔细的介绍一下夸克网盘的文件怎么保存到百度网盘方法吧。 夸克网盘的文件怎么保存到百度网盘方法 1、想要知道怎么把夸克网盘的文件转到百度网盘,首先在夸克网盘上下载需要保存的文件,然后打开百度网盘客户端后,选择压缩文件要保存的文件夹,双击打开该文件夹。 2、打开该文件夹后,点击窗口左上角区域的“上传”。 3、在电脑中找到需要上传的压缩文件,点击选

在使用C++进行编程时,经常会遇到未声明的标识符这个问题。这种情况通常发生在使用了未定义的变量、函数或类时,导致编译器无法识别这些标识符,进而产生编译错误。本文将介绍导致未声明的标识符问题的常见原因以及如何解决这个问题。常见原因未声明的标识符问题通常由以下几种原因导致:变量、函数或类未被正确声明:在使用变量、函数或类之前,应该先声明它们。如果变量未被声明或函

1、首先我们进入到网易云音乐中,然后在软件首页界面中,点击进入到歌曲的播放界面中。2、然后在歌曲播放界面中,找到右上方的分享功能按钮,如下图红框所示位置,点击选择分享的渠道;在分享渠道中,点击底部的“分享至”选项,然后选择第一个“微信朋友圈”,即可将内容分享至微信朋友圈。

近期,百度网盘安卓客户端迎来了全新的8.0.0版本,这一版本不仅带来了众多变化,还增添了诸多实用功能。其中,最为引人注目的便是文件夹共享功能的增强。现在,用户可以轻松邀请好友加入,共同分享工作和生活中的重要文件,实现更加便捷的协作与共享。那么究竟该如何分享给好友自己需要分享的文件呢,下文中本站小编就将为大家带来详细内容介绍,希望能帮助到大家!1)打开百度云APP,首先点击在首页中选择相关的文件夹,然后再点击界面右上角的【...】图标;(如下图)2)随后点击“共享成员”一栏中的【+】,最后在勾选所

芒果TV拥有各种类型的电影、电视剧、综艺等资源,用户可以在其中自由的选择进行观看。芒果tv会员不仅能够看到全部的VIP剧而且还能够设置最高清的画质,帮助用户爽快看剧,下面小编就给大家带来一些芒果tv免费的会员账号供用户们使用,赶紧来看一看吧。芒果tv最新会员账号免费分享2023:注意:都是收集的最新会员账号,可以直接登录使用,不要随意的修改密码。账号:13842025699密码:qds373账号:15804882888密码:evr6982账号:13330925667密码:jgqae账号:1703

惠普打印机是很多办公室内必备的打印设备,在电脑上安装打印机驱动,可以完美解决打印机无法连接等等问题。那么惠普打印机驱动怎么安装?下面小编就给大家介绍两个惠普打印机驱动程序安装方法。 第一种方法:官网下载驱动 1、在搜索引擎中搜索惠普中国官网,在支持一栏中,选择【软件与驱动程序】。 2、选择【打印机】分类,在搜索框中输入你的打印机型号,点击【提交】,即可查找到你的打印机驱动。 3、根据你电脑的系统选择对应的打印机,win10即选择win10系统的驱动。 4、下载成功后,在文件夹中找到

番茄小说是丰富的小说宝库,其中汇聚了海量优质的小说资源。在这里,你可以根据自己的喜好,从多种不同类型的小说中挑选出心仪之作。对于热爱阅读的你,这无疑是一片可以自由翱翔的文学天地。有的时候遇到心仪的读物也像分享给好友一起阅读,但是很多用户们还不清楚究竟该如何分享,那么这篇教程攻略就将为大家带来详细的攻略介绍,想要了解的玩家们就快来跟着本文一起阅读吧!番茄小说怎么分享书给好友?1、打开番茄小说,点击进入小说,点击右上角分享图标。2、选择分享渠道,这里小编以分享至微信好友为例。3、点击分享。4、即可查

标题:解决Discuz微信分享无法显示的问题,需要具体代码示例随着移动互联网的发展,微信成为了人们日常生活中不可或缺的一部分。在网站开发中,为了提升用户体验和扩大网站的曝光度,很多站点会集成微信分享功能,让用户能够方便地分享网站的内容到朋友圈或者微信群中。然而,有时候在使用Discuz等开源论坛系统时,会遇到微信分享无法显示的问题,这给用户体验带来了一定的困
