您的位置:首页 > 编程语言 > Qt开发

编译arm版本的QT遇到的问题

2014-10-09 09:23 429 查看


1.libQtCore.so: undefined reference to`clock_gettime’

环境:arm qt4.5
问题:libQtCore.so: undefined reference to`clock_gettime'
分析:应该是找不到库文件
librt.so (POSIX.1bRealtime Extensions library)
解决:
办法一:重新编译qt4.5
在./configure后添加参数
-lrt
我用的是天嵌embeded,修改arm_qt4.5_build,如下:

echoyes | ../../qt-embedded-linux-opensource-src-4.5.0/configure -prefix/opt/EmbedSky/qt-4.5/__install/arm/ -release -shared -fast-no-largefile -qt-sql-sqlite -no-qt3support -no-xmlpatterns -no-mmx-no-3dnow -no-sse -no-sse2 -no-svg -no-webkit -qt-zlib-qt-gif

-qt-libtiff -qt-libpng -qt-libjpeg -make libs -nomakeexamples -nomake docs -nomake demo -no-nis -no-cups -no-iconv-no-dbus -no-openssl -xplatform qws/linux-arm-g++ -embedded arm-little-endian -qt-freetype -depths 16 -qt-gfx-linuxfb-qt-gfx-transformed -qt-gfx-multiscreen

-no-gfx-vnc -no-gfx-qvfb-qt-kbd-usb -no-glib -armfpa -no-mouse-tslib -I/tslib-1.4/inclued-L/tslib-1.4/lib -lrt &&
办法二:修改Makefile
在makefile中找的LIBS,在其后添加-lrt

2.交叉编译器的配置

在目录/home/eric/qt_transplant/qt-embedded-linux-opensource-src-4.5.3-arm/mkspecs/qws/linux-arm-g++修改qmake.conf

# modifications to g++.conf

QMAKE_CC = arm-linux-gnueabi-gcc

QMAKE_CXX = arm-linux-gnueabi-g++

QMAKE_LINK = arm-linux-gnueabi-g++

QMAKE_LINK_SHLIB = arm-linux-guneabi-g++

# modifications to linux.conf

QMAKE_AR = arm-linux-gnueabi-ar cqs

QMAKE_OBJCOPY = arm-linux-gnueabi-objcopy

QMAKE_STRIP = arm-linux-gnueabi-strip
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: