`

QT编译出错解决

    博客分类:
  • QT
阅读更多

可能出错1:


libQtCore.so: undefined reference to `QInotifyFileSystemWatcherEngine::create()'

解决办法:
vi ./src/corelib/io/io.pri
find linux-*:
append your cross-toolchain's prefix after it

举例:
my toolchains's prefix is arm_xxxxx
so....
68        linux-*|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'

解决办法:
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'

make[1]: *** [.obj/release-shared-emb-arm/qfontengine_ft.o] Error 1

make[1]: Leaving directory `/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/src/gui'

make: *** [sub-gui-make_default-ordered] Error 2

解决办法:

To fix this issue patch /src/3rdparty/freetype/include/freetype/config/ftconfig.h Line 330.

"orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */

to "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */

PS: 都说是交叉编译器版本问题,用4.5.1就好了... 没试过...



可能出错4:

In file included from ./config.h:26,

from ../JavaScriptCore/pcre/pcre_compile.cpp:44:

../JavaScriptCore/wtf/Platform.h:338:6: #error "Not supported ARM architecture"

make[1]: *** [obj/release/pcre_compile.o] Error 1

make[1]: Leaving directory `/usr/local/qte4.6-arm/src/3rdparty/webkit/WebCore'

make: *** [sub-webkit-make_default-ordered] Error 2

解决办法:

在参数上加 -D__ARM_ARCH_5TEJ__ 或者 -D__ARM_ARCH_4T

或者修改src/3rdparty/webkit/WebCore/Makefile,在cflags中加入-D__ARM_ARCH_4T__ 修改src/script/Makefile,同上

 


可能出错5:

warning: libts-0.0.so.0, needed by , not found (try using -rpath or -rpath-link)

undefined reference to `ts_read_raw'

undefined reference to `ts_open'

undefined reference to `ts_fd'

undefined reference to `ts_config'

undefined reference to `ts_close'

undefined reference to `ts_read'

collect2: ld returned 1 exit status

解决办法:

修改qt-everywhere-opensource-src-4.6.0/mkspecs/qws/linux-arm-g++/qmake.conf 文件(添加lts参数):

QMAKE_CC                = arm-linux-gcc -lts

QMAKE_CXX               = arm-linux-g++ -lts

QMAKE_LINK              = arm-linux-g++ -lts

QMAKE_LINK_SHLIB        = arm-linux-g++ -lts

还有个错误是加了-pch 参数引起的,具体错误内容忘了。

另外一定要在编译之前确认arm-linux-gcc等环境在当前shell下是否有效,如果出错最好拿一份新的源码再去编译,之前就是因为没有换而浪费了很多时间。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics