qtopia编译错误

在编译过程中会出现很多的错误,包括飞凌提供的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]: *** [http://www.cnblogs.com/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 <= frameworks/base/tools/aidl/aidl_language_l.l
      /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<T>::pop() [with T = QMap<QString, QString>]‘: 
xml/qxml.cpp:513:   instantiated from here 
   /home/work/armqt/qtlibsource/qt-x11/include/qvalue stack.h:57: 错误:不能从‘QValueListIterator<QMap<QString, QString> >‘转换到‘const char*‘,为实参‘1‘(属于‘int remove(const char*)‘) 
/home/work/armqt/qtlibsource/qt-x11/include/qvalue stack.h: In member function ‘T QValueStack<T>::pop() [with T = QString]‘: 
xml/qxml.cpp:2502:   instantiated from here 
  /home /work/armqt/qtlibsource/qt-x11/include/qvalue stack.h:57: 错误:不能从‘QValueListIterator<QString>‘转换到‘const char*‘,为实参‘1‘(属于‘int remove(const char*)‘)
    解决办法:
         参见ok6410移植百科全书。

错误十四:没有找到uic工具  错误提示:

make[5]: /root/yizhi/host/qtopia-free-2.2.0/qt2/bin/uic: Command not found
    make[5]: *** [http://www.cnblogs.com/../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::

继续编译:
     http://www.cnblogs.com/../include/qtopia/pim/private/http://www.cnblogs.com/http://www.cnblogs.com/src/libraries/qtopiapim/numberentry_p.h: At global scope:
http://www.cnblogs.com/../include/qtopia/pim/private/http://www.cnblogs.com/http://www.cnblogs.com/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

时间: 2024-10-10 16:28:42

qtopia编译错误的相关文章

visual studio编译错误集(转)

1.error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 在项目属性->Configration Properties->C/C++->Command Line页面的Additional Options中加入/wd4430 2.error MSB3073: The command regsvr32 /s /c 解决办法 最近将VC2002 代码移植到VC2010,

Error:Execution failed for task &#39;:app:compileDebugAidl&#39;. &gt; aidl is missing(Android Studio编译错误)

今天下载了一个1.2.1.1版本的Android Studio,使用VPN更新好SDK之后就新建了一个hello world工程测试一下环境,然后就出现以下错误: Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing 什么情况?全新安装的环境也有错误?Google发布这个工具时没有测试好吗? 没搞过这个工具,一阵搜索得到以下方案: 1.右键工程->Open Module Settings 2.将Bu

Cocos2d-x文件编译错误解决

编译出现的错误: 1>------ 已启动生成: 项目: HelloCpp, 配置: Debug Win32 ------ 1>生成启动时间为 2014/5/9 14:43:43. 1>InitializeBuildStatus: 1>  正在创建"Debug.win32\HelloCpp.unsuccessfulbuild",因为已指定"AlwaysCreate". 1>ClCompile: 1>  所有输出均为最新. 1>

解决新建Support7Demos的sample时出现编译错误和运行报错出现的问题

右键New->Other->Android Sample Project->选择Android 4.4.2->选择Support7Demos ,finish. 会出现编译错误 解决如下: 1.把这三个文件导入到Eclipse里, 这三个是库文件,并且勾选COPY到工作空间里选项 如果没有这三个文件,就从这里下载 2.导入三个library工程后,mediarouter会无法编译,打开工程属性在anroid里将api-level改成17,添加依赖工程appcompat 3.就是将刚才

java编译错误 程序包javax.servlet不存在javax.servlet.*

java编译错误 程序包javax.servlet不存在javax.servlet.* 编译:javac Servlet.java 出现 软件包 javax.servlet 不存在 软件包javax.servlet.http 不存在 等错误 由于servlet和JSP不是Java平台JavaSE(标准版)的一部分,而是Java EE(企业版)的一部分,因此,必须告知编译器servlet的位置. 解决“软件包 javax.servlet不存在”错误的方法: 1. 搜索servlet-api.jar

Xcode编译错误和警告汇总&lt;转&gt;

1.error: macro names must be identifiers YourProject_prefix.pch 原因: 因为你弄脏了预处理器宏,在它处于<Multiple Values>的时候修改了它 解决方法: Configiration选择All Configirations,清空它 然后分别重新定义你的Debug,Release,Distributin预处理器宏吧 2.warning: no rule to process file '$(PROJECT_DIR)/Loa

C编译错误解决方法

1.expected identifier before numeric constant 一般情况下是枚举类型中的某个变量已经被#define定义过一次了,在项目空间中搜索你枚举类型中的所有变量类型,看看是否被#define过,如果被#define过,就把#define的删除或换个名字. C编译错误解决方法,布布扣,bubuko.com

VS2010出现FileTracker : error FTK1011编译错误的解决办法

VS2010出现FileTracker : error FTK1011不知道是不是vs2010的一个bug,反正有人提交了. FileTracker : error FTK1011编译错误的解决办法有三个,推荐使用第二个 方法一:把目标框架改为Framewotk=4.0方法二:新增环境变量TRACKFILEACCESS=false:操作步骤:右击"我的电脑"(或"计算机")-->"高级"-->"环境变量"-->

xcode 编译错误找不到 libz.dylib

图片对应的是libxml2.dylib  (libz.dylib 遇到的编译错误跟这个类似) 解决方法是在引入库的地方调整原先 比如libz.dylib 的目录: ======================= ================================== 解决方法: target---build phases--- link binary with libraries---添加---add ohter---command+shift+G----/usr/lib/ ---