完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
全部操作基于OK6410-A开发板用户光盘中的《Qt移植百科全书》。
1.不兼容的库 -L/usr/X11R6/lib -lXext -lX11 -lm -lSM -lICE -ldl -lpthread /usr/bin/ld: 当搜索用于 //usr/lib/x86_64-linux-gnu/libXext.so 时跳过不兼容的 -lXext /usr/bin/ld: 当搜索用于 //usr/lib/x86_64-linux-gnu/libXext.a 时跳过不兼容的 -lXext /usr/bin/ld: 找不到 -lXext /usr/bin/ld: 当搜索用于 //usr/lib/x86_64-linux-gnu/libX11.so 时跳过不兼容的 -lX11 /usr/bin/ld: 当搜索用于 //usr/lib/x86_64-linux-gnu/libX11.a 时跳过不兼容的 -lX11 /usr/bin/ld: 找不到 -lX11 /usr/bin/ld: 当搜索用于 //usr/lib/x86_64-linux-gnu/libSM.so 时跳过不兼容的 -lSM /usr/bin/ld: 当搜索用于 //usr/lib/x86_64-linux-gnu/libSM.a 时跳过不兼容的 -lSM /usr/bin/ld: 找不到 -lSM /usr/bin/ld: 当搜索用于 //usr/lib/x86_64-linux-gnu/libICE.so 时跳过不兼容的 -lICE /usr/bin/ld: 当搜索用于 //usr/lib/x86_64-linux-gnu/libICE.a 时跳过不兼容的 -lICE /usr/bin/ld: 找不到 -lICE collect2: error: ld returned 1 exit status 此时我已经安装了 libavahi-client-dev libavahi-common-dev libavahi-glib-dev libavahi-gobject-dev libdbus-1-dev libexpat1-dev libfontconfig1-dev libfreetype6-dev libglib2.0-dev libice-dev libsm-dev libxrender-dev x11proto-render-dev libavahi-client-dev libavahi-common-dev libavahi-glib-dev libdbus-1-dev libexpat1-dev libglib2.0-dev libice-dev x11proto-render-dev lib32z1-dev gcc-multilib这些库。 通过搜索资料,我查到一个类似情况,说应该把-m32从命令行标志中删去,但我这里没有-m32,是否应该加上?怎么添加呢? 2.uic权限不足 /root/yizhi/host/qtopia-free-2.2.0/qt2/bin/uic passwordbase_p.ui -o ../../../include/qtopia/private/passwordbase_p.h make[5]: execvp: /root/yizhi/host/qtopia-free-2.2.0/qt2/bin/uic: 权限不够 Makefile.target:1395: recipe for target '../../../include/qtopia/private/passwordbase_p.h' failed make[5]: *** [../../../include/qtopia/private/passwordbase_p.h] Error 127 于是执行chmod 777 ,重新编译,依然报错。 请问诸位大佬,这个应该怎么解决呢?谢谢 |
|
相关推荐
3个回答
|
|
linux下QT编译出现collect2:ld returned 1 exit status错误的原因之一是未安装mesa
解决方法: 终端输入sudo apt install libgl1-mesa-dev即可安装 重启QT。 权限问题应该是编译内容在root用户下,是root权限,可能您是在普通用户下编译的。 |
|
|
|
本节主要讲述 s3c6010 上的Qtopia2.2.0 的编译方法。 PC版本,qvfb运行的Qtopia2.2.0 的编译 也可以参考。
PC环境:Ubantu9.10 开发板:s3c6410 交叉编译器:arm-linux-gcc4.4.1/arm-linux-gcc 4.3.2 下面开始arm版本Qtopia2.2.0版本的编译 如果您还没有安装arm-linux-gcc-4.4.1 交叉编译器,请先安装该交叉编译器到/usr/local/arm 下面,把arm-linux-gcc-4.4.1压缩包解压到该目录即可完成安装。 需要注意的是: 1 编译Qtopia时确保您的Ubantu9.10环境中安装了GNU g++编译器,Qtopia编译过程中用这个编译器用来编译一些工具在PC上运行. 2 注意您的Ubantu中要安装X11的SDK库,Qtopia编译过程中需要使用X11SDK里面的一些头文件,使用以下命令即可安装需要的文件 #apt-get install libx11-dev libxext-dev libxtst-dev 另外需要安装工具uuid(Universally Unique Identifier,)和 xmu库文件, 编译Qtopia2.2.0时需要这些在PC上运行的工具和第三方库文件 apt-get install uuid-dev apt-get install libxmu-dev libxmu6 如果不安装 uuid和xmu将会出现下面的错误: 没有安装xmu时,编译提示: /usr/bin/ld:cannot find -lXmu 没有安装uuid时,编译提示: 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 3 编译时 虚拟机中的ARM-qtopia-free-src-2.2.0.tar.gz 文件不能放在与Windows共享的目录中,否则会编译出错. 说明:以下的错误信息是按照 先后顺序 发现和处理的,用户可以根据自己的错误类型信息,自己进行修改. 这些错误是自己经历并解决的,也参考了其他网友的一些办法,总结一下,与大家分享 1 编译错误: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 解决办法: 在Ubuntu 9.10上, gcc会严格检查open()的参数传递,如果第二个参数为O_CREAT的话(就像qtopia-2.2.0- FriendlyARM/qt2/src /tools/qmemoryfile_unix.cpp的143行这样),必须传入第三个参数mode。因此,手动修改x86-qtopia- 2.2.0/qt2/src/tools/qmemoryfile_unix.cpp 143行将 if (!f) f = open(tmpFile.latin1(), O_CREAT | O_WRONLY); 修改为 if (!f) f = open(tmpFile.latin1(), O_CREAT | O_WRONLY, 0666); 2 使用未定义的类 error: ‘QWSInputMethod’ has not been declared 修正方法: cd $QTDIR/src/kernel gedit qwindowsystem_qws.h 在前面增加以下两行 class QWSInputMethod; class QWSGestureMethod; 该文件中使用了这两个类,C++允许在文件中这样声明其他地方定义的类,减少头文件的相互包含关系,加快编译速度 3 缺少头文件 错误信息: kernel/qpixmapcache.cpp:125:57: error: asm/page.h: No such file or directory kernel/qpixmapcache.cpp: In constructor ‘QSharedMemoryManager::QSharedMemoryManager()’: kernel/qpixmapcache.cpp:539: error: ‘PAGE_SIZE’ was not declared in this scope kernel/qpixmapcache.cpp:539: error: ‘PAGE_MASK’ was not declared in this scope kernel/qpixmapcache.cpp: In member function ‘void QSharedMemoryManager::internal_free(QSMemPtr)’: kernel/qpixmapcache.cpp:773: error: ‘PAGE_SIZE’ was not declared in this scope kernel/qpixmapcache.cpp:773: error: ‘PAGE_MASK’ was not declared in this scope make[1]: *** [tmp/release-shared-linux-generic-g++-no-keypad/kernel/qpixmapcache.o] Error 1 make[1]: Leaving directory `/root/yizhi/host/qtopFolder[ 解决办法:2.6内核中不再含有asm-i386的page.h 修改qt2/src/kernel/qpixmapcache.cpp 文件 #ifdef THROW_AWAY_UNUSED_PAGES # include #define PAGE_SHIFT 12 //new add 2010-12-10 #define PAGE_SIZE (1UL << PAGE_SHIFT) //new add 2010-12-10 #define PAGE_MASK (~(PAGE_SIZE-1)) //new add 2010-12-10 //# include 4 类型转换错误 /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 解决办法: template class Q_EXPORT QValueStack : public QValueList {undefined public: QValueStack() {} ~QValueStack() {} void push( const T& d ) { append(d); } T pop() {undefined T elem( this->last() ); if ( !this->isEmpty() ) this->remove( this->fromLast() );// add "this->" 2010-12-10 return elem; } 5 没有找到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下面,即可 6 多余的符号错误,即类的成员函数在头文件中不需要加类名 qdawg.cpp:294: error: extra qualification ‘QDawgPrivate::’ on member ‘QDawgPrivate’ make[5]: *** [.obj/release-shared/qdawg.o]oo 解决办法: qtopia-free-2.2.0/qtopia/src/libraries/qtopia/qdawg.cpp 里面的 QDawgPrivate::~QDawgPrivate() {undefined delete memoryFile; } 修改为: ~QDawgPrivate() // delete "QDawgPrivate::~" 2010-12-10 {undefined delete memoryFile; } 7 指针类型转换出错: 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 文件149行 char *dot = strrchr(g,'.'); 修改为 char *dot = (char *)strrchr(g,'.'); 8 错误:编译器找不到QSizePolicy类的五个参数的构造函数 ui/release-shared/passwordbase_p.cpp:35: error: no matching function for call to ‘QSizePolicy::QSizePolicy(QSizePolicy::SizeType, QSizePolicy::SizeType, int, int, bool)’ /root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:93: note: candidates are: QSizePolicy::QSizePolicy(int) /root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:99: note: QSizePolicy::QSizePolicy(QSizePolicy::SizeType, QSizePolicy::SizeType, bool) /root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:63: note: QSizePolicy::QSizePolicy() /root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:46: note: QSizePolicy::QSizePolicy(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 两个参数 9 g++编译器提示 有多余的符号在成员函数前 ,有些编译器规定C++成员函数前不需要再加这个类的名字,与第6处错误雷同 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 解决办法: 修改 qtopia-free-2.2.0/qtopia/src/libraries/qtopiapim/abtable_p.h 文件中276行 QListViewItem* PhoneTypeSelector::addType(QListViewItem* prevItem, QString number, const char* pixmapName, PimContact::ContactFields phoneType); 修改为: QListViewItem* addType(QListViewItem* prevItem,QString number, const char* pixmapName, PimContact::ContactFields phoneType); 也就是去掉 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 解决办法: 修改 qtopia-free-2.2.0/qtopia/src/libraries/qtopiapim/numberentry_p.h 第106行 bool NumberEntryDialog::eventFilter(QObject *o, QEvent *e); 修改为 bool eventFilter(QObject *o, QEvent *e); 继续: make[5]: Leaving directory `/root/yizhi/host/qtopia-free-2.2.0/qtopia/src/libraries/mediaplayer' make[4]: *** [all] Error 2 make[4]: Leaving directory `/root/yizhi/host/qtopia-free-2.2.0/qtopia/src/libraries/mediaplayer' 修改 qtopia-free-2.2.0/qtopia/src/libraries/mediaplayer/videoviewer.cpp 文件 52行 SimpleVideoWidget::SimpleVideoWidget(QWidget *parent); 修改后: SimpleVideoWidget(QWidget *parent); //构造函数 继续编译 In file included from addres***ook.cpp:40: ablabel.h: At global scope: ablabel.h:78: error: extra qualification ‘AbLabel::’ on member ‘decodeHref" 解决办法: 修改 qtopia-free-2.2.0/qtopia/src/applications/addres***ook/ablabel.h 78行 bool AbLabel::decodeHref(const QString& href, ServiceRequest* req, QString* pm) const; 修改为 bool decodeHref(const QString& href, ServiceRequest* req, QString* pm) const; |
|
|
|
10 又一处未经定义的构造函数错误提示:
.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::QSizePolicy(QSizePolicy::SizeType, QSizePolicy::SizeType, int, int, bool)’ /root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:93: note: candidates are: QSizePolicy::QSizePolizePolicj4 修改 qtopia-free-2.2.0/qtopia/src/applications/addres***ook/.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::QSizePolicy(QSizePolicy::SizeType, QSizePolicy::SizeType, int, int, bool)’ /root/yizhi/host/qtopia-free-2.2.0/qt2/include/qsizepolicy.h:93: note: candidates are: QSizePolicy::QSizePolicy(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() ) ); 继续编译。同样是这个类型的错误,这里就不再列出了,用户可以仿照上面的方法,根据错误提示信息,自己进行修改,修改后保存,继续编译。 |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1988 浏览 1 评论
synopsys 的design ware:DW_fpv_div,浮点数除法器,默认32位下,想提升覆盖率(TMAX),如果用功能case去提升覆盖率呢?
2490 浏览 1 评论
RK3588 GStreamer调试四路鱼眼摄像头四宫格显示报错
5272 浏览 1 评论
【飞凌嵌入式OK3576-C开发板体验】RKNN神经网络-YOLO图像识别
254 浏览 0 评论
【飞凌嵌入式OK3576-C开发板体验】SSH远程登录网络配置及CAN通讯
1336 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 13:44 , Processed in 0.804337 second(s), Total 78, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号