如题 需要编译生成相应的qt库,但是make的时候出错,各种方法都尝试了,还是没有头绪,望大神能指点迷津!以下是具体步骤:下载qt源码:qt-everywhere-opensource-src-4.8.6.tar.gz。
解压、放到/usr/local/目录下:/usr/local/qt-everywhere-opensource-src-4.8.6。
配置海思交叉编译工具路径:
export PATH=/opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/usr/bin:$PATH修改qmake配置文件/usr/local/qt-everywhere-opensource-src-4.8.6/mkspecs/qws/linux-arm-g++下的qmake.conf: # modifications to g++.confQMAKE_CC = arm-linux-gccQMAKE_CXX = arm-linux-g++QMAKE_LINK = arm-linux-g++QMAKE_LINK_SHLIB = arm-linux-g++# modifications to linux.confQMAKE_AR = arm-linux-ar cqsQMAKE_OBJCOPY = arm-linux-objcopyQMAKE_STRIP = arm-linux-strip修改为: # modifications to g++.confQMAKE_CC = arm-hismall-linux-gccQMAKE_CXX = arm-hismall-linux-g++QMAKE_LINK = arm-hismall-linux-g++QMAKE_LINK_SHLIB = arm-hismall-linux-g++# modifications to linux.confQMAKE_AR = arm-hismall-linux-ar cqsQMAKE_OBJCOPY = arm-hismall-linux-objcopyQMAKE_STRIP = arm-hismall-linux-strip准备工作完成,开始运行配置文件并裁剪qt库: ./configure -embedded arm -xplatform qws/linux-arm-g++ -release -opensource -fast -stl -no-accessibility -no-scripttools -no-mmx -no-multimedia -no-svg -no-3dnow -no-sse -no-sse2 -no-libmng -no-libtiff -no-multimedia -silent -qt-libpng -qt-libjpeg -make libs -nomake tools -nomake examples -nomake docs -nomake demos -nomake translations -no-nis -no-cups -no-iconv -no-dbus -no-openssl -little-endian -qt-freetype -depths all -qt-gfx-linuxfb -no-gfx-transformed -no-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput -no-glib -no-phonon -no-phonon-backend -no-webkit -no-javascript-jit -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-sql-sqlite_symbian -no-sql-symsql -no-sql-tds -no-qt3support -qt-mouse-linuxinput -no-mouse-linuxtp -no-script -no-largefile(这里因为没有用到触摸屏所以没有配置tslib库,不知道是不是这个原因)ok,配置完成!接着运行make命令,编译qt源码,出现下列
错误:
- make[1]: Entering directory `/usr/local/qt-everywhere-opensource-src-4.8.6/src/corelib'
- arm-hismall-linux-g++ -c -pipe -fno-exceptions -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER=\"/lib/ld-linux.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -I/qws/linux-arm-g++ -I. -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -o .obj/release-shared-emb-arm/qabstractanimation.o animation/qabstractanimation.cpp
- In file included from animation/qabstractanimation.cpp:145:
- animation/qabstractanimation.h:45:28: QtCore/qobject.h: No such file or directory
- In file included from animation/qabstractanimation.cpp:145:
- animation/qabstractanimation.h:47: error: `QT_BEGIN_HEADER' does not name a type
- animation/qabstractanimation.h:60: error: invalid function declaration
- animation/qabstractanimation.h:137: error: invalid function declaration
- animation/qabstractanimation.h:168: error: `QT_END_NAMESPACE' does not name a type
- In file included from animation/qabstractanimation.cpp:146:
- animation/qanimationgroup.h:45:39: QtCore/qabstractanimation.h: No such file or directory
- In file included from animation/qabstractanimation.cpp:146:
- animation/qanimationgroup.h:56: error: invalid function declaration
- animation/qanimationgroup.h:84: error: `QT_END_NAMESPACE' does not name a type
- animation/qabstractanimation.cpp:148:27: QtCore/qdebug.h: No such file or directory
- In file included from animation/qabstractanimation.cpp:150:
- animation/qabstractanimation_p.h:56:32: QtCore/qbasictimer.h: No such file or directory
- animation/qabstractanimation_p.h:57:30: QtCore/qdatetime.h: No such file or directory
- animation/qabstractanimation_p.h:58:27: QtCore/qtimer.h: No such file or directory
- animation/qabstractanimation_p.h:59:34: QtCore/qelapsedtimer.h: No such file or directory
- ....(后面错误太多不贴了,就是说qt的路径不对,但是手动在makefile里面添加路径,又提示moc_qabstractanimation.cpp:No such file or directory)
受困几天了,一直没有找到原因,望大神指点指点啊!