首页| 论坛| 消息

标题:编绎在ARM上运行的QT应用程序出错,谁能帮帮我
作者:玉石俱焚ing
日期:2015-05-01 23:00
内容:

我在ubuntu上用ARM-linux-gcc重新编绎了QT,在Trolltech下生成QtEmbedded-4.8.6-arm目录,添加环境变量后qmake -v
root@ubuntu:/home/shiyu/qtex1# qmake -v
QMake version 2.01a
Using Qt version 4.8.6 in /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib
使用了新的qmake
然后我写了个hello.cpp用新的qmake编绎,make里就出现了下面的错误,
root@ubuntu:/home/shiyu/qtex1# make
arm-linux-gnueabihf-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/mkspecs/qws/arm-linux-gnueabihf-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include -I. -I. -o hello.o hello.cpp
hello.cpp:4:5: warning: unused parameter ‘argc’ [-Wunused-parameter]
hello.cpp:4:5: warning: unused parameter ‘argv’ [-Wunused-parameter]
arm-linux-gnueabihf-g++ -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -o hello hello.o-L/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -lQtNetwork -lQtCore -lpthread
/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtCore.so: undefined reference to `QInotifyFileSystemWatcherEngine::create()'
/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtCore.so: undefined reference to `clock_gettime'
/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtCore.so: undefined reference to `QDnotifyFileSystemWatcherEngine::create()'
collect2: error: ld returned 1 exit status
make: *** 错误 1
找了好久都没解决方法,那位大神遇到过这个问题啊?


#1 [sharkoasis 05-02 20:42]
QT编译出错解决
可能出错1:
libQtCore.so: undefined reference to `QInotifyFileSystemWatcherEngine::create()'
resolution:
vi ./src/corelib/io/io.pri
find linux-*:
append your cross-toolchain's prefix after it
eg:
my toolchains's prefix is arm_xxxxx
so....
68linux-*|arm-linux-*:{//该行改为
69 SOURCES += \
70 io/qfilesystemwatcher_inotify.cpp \
71 io/qfilesystemwatcher_dnotify.cpp
72
73 HEADERS += \
74 io/qfilesystemwatcher_inotify_p.h \
75 io/qfilesystemwatcher_dnotify_p.h
76 }
注意:更改后,要重新编译QT
可能出错2:
libQtCore.so: undefined reference to `clock_gettime'
resolution:

LFLAGS 编译选项中添加 -lrt
append "-lrt" parameters after the "./configure" so that the compiler can find the define in librt.
可能出错3:
{standard input}: Assembler messages:
{standard input}:778: Error: register or shift expression expected -- `orr r3,r2,lsl#16'
{standard input}:789: Error: register or shift expression expected -- `orr r2,r3,lsl#16'
{standard input}:7748: Error: register or shift expression expected -- `orr r3,r0,lsl#16'
{standard input}:7761: Error: register or shift expression expected -- `orr r1,r0,lsl#16'
m ..

回复 发表
主题 版块