1. tar xvfz qt-2.3.10.tar.gz 2. QTDIR=/home/qt-2.3.10 LD_LIBRARY_PATH=$QTDIR/libLD_LIBRARY_PATH PATH=$QTDIR/binPATH export QTDIR LDLIBRARY_PATH 3. ./configure -xplatform linux-arm-g++ -shared 注意配置时 -shared前有个空格的,否则配置出错。 输入yes,5,16,no 4. make 5. 后来更换高版本的编译器后 连接例子时提示未定义的 __cxa_pure_virtual函数,解决方法是 改变该例子的Makefile里的arm-linux-gcc为 arm-linux-g++即可。
出错误后: vim src/allmoc.cpp 加入下面的函数。
extern 'C' void __cxa_pure_virtual(void) { //CYG_FAIL('attempt to use a virtual function before object has been constructed'); for(;;); }
void* operator new[](size_t size) { return malloc(size); }
void* operator new(size_t size) { return malloc(size); }
void operator delete[](void* p) { free(p); }
void operator delete[](void* p, size_t size) { free(p); }
void operator delete(void* p) { free(p); }
void operator delete(void* p, size_t size) { free(p); } 拷贝lib目录到根文件系统就可以测试了。
arm-linux-gcc -v Reading specs from /home/toolchain/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/specs Configured with: /work/crosstool-0.27/build/arm-linux/gcc-3.4.1-glibc-2.3.2/gcc-3.4.1/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/usr/local/arm/3.4.1 --with-headers=/usr/local/arm/3.4.1/arm-linux/include --with-local-prefix=/usr/local/arm/3.4.1/arm-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long Thread model: posix gcc version 3.4.1
|