手机版
你好,游客 登录 注册
背景:
阅读新闻

Ubuntu7.04下arm交叉编译

[日期:2008-01-02] 来源:Linux公社  作者:Linux [字体:大 中 小]
三。tmake问题
1.编译tmake/e/make时遇到的问题
armon@after17:/opt/FriendlyARM/SBC2410/x86-qtopia/tmake/e$ make
g++-2.95 -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/FriendlyARM/SBC2410/x86-qtopia/qt/include -o hello.o hello.cpp
g++-2.95 -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/FriendlyARM/SBC2410/x86-qtopia/qt/include -o main.o main.cpp
/opt/FriendlyARM/SBC2410/x86-qtopia/qt/bin/moc hello.h -o moc_hello.cpp
g++-2.95 -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/FriendlyARM/SBC2410/x86-qtopia/qt/include -o moc_hello.o moc_hello.cpp
gcc-2.95 -o hello hello.o main.o moc_hello.o -L/opt/FriendlyARM/SBC2410/x86-qtopia/qt/lib -lqte
/opt/FriendlyARM/SBC2410/x86-qtopia/qt/lib/libqte.so: undefined reference to `sin'
/opt/FriendlyARM/SBC2410/x86-qtopia/qt/lib/libqte.so: undefined reference to `pow'
/opt/FriendlyARM/SBC2410/x86-qtopia/qt/lib/libqte.so: undefined reference to `cos'
collect2: ld returned 1 exit status
make: *** [hello] 错误 1

//解决:http://www.qobject.com/simple/index.php?t4561.html
整个的配置过程就是这样,然后我进QT/examples/hello,make 出现的错误如下:/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `operator new[](unsigned)'
/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `cos'
/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `sin'
/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `__cxa_pure_virtual'
/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `pow'
/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `operator delete[](void*)'
collect2: ld returned 1 exit status
好像在哪个贴子上说过只要在Makefile的LIB加上-lm能消除这错误,但是我加上后出现错误如下:
undefined reference to `operator delete(void*)'
/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `operator new[](unsigned)'
/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `__cxa_pure_virtual'
/friendly-arm/x86-qtopia/qt/lib/libqte.so: undefined reference to `operator delete[](void*)'
collect2: ld returned 1 exit status
make: *** [hello] Error 1
希望哪位能帮助我,急!在线等!

//重点:好像在哪个贴子上说过只要在Makefile的LIB加上-lm能消除这错误
修改Makefile,加上 -lm可以了,
同时注意修改Makefile里的gcc -> gcc-2.95
g++ -> g++-2.95
make前make clean一次清楚上次的.o文件


2.运行 ./hello时的问题
armon@after17:/opt/FriendlyARM/SBC2410/x86-qtopia/tmake/e$ ./hello
./hello: error while loading shared libraries: libqte.so.2: cannot open shared object file: No such file or directory
// 注意运行前的环境变量设置
//cd /opt/FriendlyARM/SBC2410/x86-qtopia
//. set-env //设置环境变量
//source /home/armon/shell/qtopia-free-1.7.0.sh //设置运行时的动态链接库
//否则:
armon@after17:/opt/FriendlyARM/SBC2410/x86-qtopia/tmake/e$ Using display 0
./hello -qws
./hello: error while loading shared libraries: libqte.so.2: cannot open shared object file: No such file or directory
因为我已经把/etc/ld.so.conf里面的加的内容给删了,加在了/home/armon/shell/qtopia-free-1.7.0.sh,每次用到时才设
否则在/etc/ld.so.conf里面改很容易造成进不了X-Window,怀疑是动态链接库的问题。

linux
相关资讯       ubuntu编译  arm 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款