免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3772 | 回复: 0
打印 上一主题 下一主题

交叉编译qt:cannot find -lstdc++和cannot find -lqte解决办法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-24 17:19 |只看该作者 |倒序浏览


  Normal
  0
  
  7.8 磅
  0
  2
  
  false
  false
  false
  
   
   
   
   
   
   
   
   
   
   
   
   
  
  MicrosoftInternetExplorer4



st1\:*{behavior:url(#ieooui) }
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:普通表格;
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
前两天碰到的一个问题终于得到初步的解决:做完qt移植到pxa255的移植之后,我用交叉编译器编译了一个小小的程序,不知道怎么回事,使劲百般功夫, 总是不能够通过,总是出错,显示/usr/local/hybus-arm-linux-R1.1/arm-linux/bin/ld:
cannot find lqte的错误,如下:
[root@localhost hello]# make
arm-linux-g++  -o hello hello.o   -L/pxa255/qt-2.3.7/lib
-lm -lqte
/usr/local/hybus-arm-linux-R1.1/arm-linux/bin/ld: cannot find -lqte
collect2: ld returned 1 exit status
make: *** [hello] Error 1
可以看出是找不到库文件libqte,可是我明明已经在前面移植到时候生成了libqte2.3.7.so这个库文件了啊,为什么还说找不到,
打开它的makefile文件,看到LIBS = $(SUBLIBS)
-L$(QTDIR)/lib -lm -lqte这么一句话,它要用到$QTDIR这个环境变量,echo了一下$QTDIR,发现不对劲,它的内容不是/pxa255/qt-2.3.7(我 的qt-embedded解压后的库就是这个路径)路径,所以会出现找不到lqte的问题。修改它export
QTDIR=/pxa255/qt-2.3.7,
重复上面的操作:
[root@localhost hello]# qmake -project
[root@localhost hello]# tmake -o makefile hello.pro
[root@localhost hello]# make
arm-linux-g++  -o hello hello.o   -L/pxa255/qt-2.3.7/lib -lm
-lqte
/usr/local/hybus-arm-linux-R1.1/arm-linux/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [hello] Error 1
又出现了如上所示的错误,这下又找不到lstdc++了,libstdc++没有这个库文件,找了一下ls /usr/local/hybus-arm-linux-R1.1/arm-linux/lib/,没有发现libstdc++这个库文件,
上网下了一个高版本的交叉编译器:arm-linux-gcc-3.3.2.tar.bz2,解压之后将lib/里的libstdc++*全复制到/usr/local/hybus-arm-linux-R1.1/arm-linux/lib/里去。
继续重复上面的操作。
[root@localhost hello]# qmake -project
[root@localhost hello]# tmake -o makefile hello.pro
[root@localhost hello]# make
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG
-I. -I/pxa255/qt-2.3.7/include -o hello.o hello.cpp
arm-linux-g++  -o hello hello.o   -L/pxa255/qt-2.3.7/lib -lm
-lqte
You have new mail in /var/spool/mail/root
[root@localhost hello]# file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0,
dynamically linked (uses shared libs), not stripped
错误解决,基本成功一半,但是暂时还没有将程序下载到板子上跑,还不知道能不能够在板子上跑起来,有时间了板子上再试一下吧。
总结:现在回头想一下,这个问题其实就不算是问题,关键原因在于自己经验不足。出现问题了不能没有头绪,要好好的分析一下出现错误的提示信息,然后再按照提示信息一步一步的解决,最终问题总能解决掉。
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/58901/showart_1663499.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP