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,怀疑是动态链接库的问题。
