构建 Qt 5.4.1 失败并显示链接器错误



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

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

-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:QtQt5.4.15.4.1srcqtbaselibQt5WebKit.dll@C:UsersUSER~1AppDataLocalTempnm4CC8.tmp
Creating library D:QtQt5.4.15.4.1srcqtbaselibQt5WebKit.lib and object D:QtQt5.4.15.4.1srcqtbaselibQt5WebKit.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:QtQt5.4.15.4.1srcqtbaselibQt5WebKit.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)

有什么想法可以解决这个问题吗?

您可以在extendTextCodecMaps中将#if OS(WINDOWS)更改为#if OS(WINCE) in qtwebkit/Source/WebCore/platform/text/TextEncodingRegistry.cpp:301 in 。

查看ChangeLog-2012-10-02,它最初仅用于Windows CE。

相关内容

  • 没有找到相关文章

最新更新