构建Qt 5.4.1失败,出现链接器错误

时间:2015-04-14 05:17:11

标签: qt qt5 linker-errors qt5.4

我试图根据http://wiki.qt.io/Building_Qt_5_from_Git的描述构建Qt 5.4.1,但没有成功。有趣的是:我收到一些关于某些缺失符号的链接器错误,而不是关于丢失的库可能来自缺少的附加包的错误!所以我在Qt本身就是一个问题。这就是我正在做的事情:

使用VS2013在Windows下构建,配置以下选项:

-debug-and-release -release -force-debug-info -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -opengl desktop -plugin-sql-sqlite

使用" nmake"成功了很长一段时间它终于失败了这个错误:

link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /OPT:REF /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.41 /MANIFEST:embed /OUT:D:\Qt\Qt5.4.1\5.4.1\src\qtbase\lib\Qt5WebKit.dll@C:\Users\USER~1\AppData\Local\Temp\nm4CC8.tmp
Creating library D:\Qt\Qt5.4.1\5.4.1\src\qtbase\lib\Qt5WebKit.lib and object D:\Qt\Qt5.4.1\5.4.1\src\qtbase\lib\Qt5WebKit.exp WebCore.lib(TextAllInOne.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl WebCore::TextCodecWin::registerExtendedEncodingNames(void (__cdecl*)(char const *,char const *))" (?registerExtendedEncodingNames@TextCodecWin@WebCore@@SAXP6AXPBD0@Z@Z) referenced in function "char const * __cdecl WebCore::atomicCanonicalTextEncodingName<unsigned char>(unsigned char const *,unsigned int)" (??$atomicCanonicalTextEncodingName@E@WebCore@@YAPBDPBEI@Z)WebCore.lib(TextAllInOne.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl WebCore::TextCodecWin::registerExtendedCodecs(void (__cdecl*)(char const *,class WTF::PassOwnPtr<class WebCore::TextCodec> (__cdecl*)(class WebCore::TextEncoding const &,void const *),void const *))" (?registerExtendedCodecs@TextCodecWin@WebCore@@SAXP6AXPBDP6A?AV?PassOwnPtr@VTextCodec@WebCore@@@WTF@@ABVTextEncoding@2@PBX@Z2@Z@Z) referenced in function "char const * __cdecl WebCore::atomicCanonicalTextEncodingName<unsigned char>(unsigned char const *,unsigned int)" (??atomicCanonicalTextEncodingName@E@WebCore@@YAPBDPBEI@Z)
D:\Qt\Qt5.4.1\5.4.1\src\qtbase\lib\Qt5WebKit.dll : fatal error LNK1120: 2 unresolved externals

为了便于阅读,这是链接器错误消息的相关部分:

unresolved external symbol "public: static void __cdecl WebCore::TextCodecWin::registerExtendedCodecs(void (__cdecl*)(char const *,class WTF::PassOwnPtr<class WebCore::TextCodec> (__cdecl*)(class WebCore::TextEncoding const &,void const *),void const *))"(?registerExtendedCodecs@TextCodecWin@WebCore@@SAXP6AXPBDP6A?AV?PassOwnPtr@VTextCodec@WebCore@@@WTF@@ABVTextEncoding@2@PBX@Z2@Z@Z)
referenced in function "char const * __cdecl WebCore::atomicCanonicalTextEncodingName<unsigned char>(unsigned char const *,unsigned int)" (??atomicCanonicalTextEncodingName@E@WebCore@@YAPBDPBEI@Z)

任何想法如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您可以在#if OS(WINDOWS)的{​​{1}}中将#if OS(WINCE)更改为qtwebkit/Source/WebCore/platform/text/TextEncodingRegistry.cpp:301

看看ChangeLog-2012-10-02它最初只用于Windows CE。