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 注意配置時(shí) -shared前有個(gè)空格的,否則配置出錯(cuò)。 輸入yes,5,16,no 4. make 5. 后來(lái)更換高版本的編譯器后 連接例子時(shí)提示未定義的 __cxa_pure_virtual函數(shù),解決方法是 改變?cè)摾拥腗akefile里的arm-linux-gcc為 arm-linux-g++即可。 出錯(cuò)誤后: vim src/allmoc.cpp 加入下面的函數(shù)。 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目錄到根文件系統(tǒng)就可以測(cè)試了。 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 |