最近见 Qt5 的 Beta 版发布了,就拖下来编译看看。在散热奇差的古董笔记本上执行编译,实在是历尽磨难,多天之后才完成任务。可惜WebKit库生成没有成功,暂时无法使用。
首先编译前需要准备 perl 和 python。python 还好,之前装了python2.7版本。perl 版本有点旧,只是 5.6,文档里要求是5.12以上。这点就挺折磨人的。
先是尝试,dirname 通不过,正则中有 \h 也通不过,无奈升级至 ActivePerl 5.14,然后继续。
总是开启编译流程,古董笔记本被整强制关机了好多次。明明是单进程编译,偏偏整出这么多的nmake。
到了 QtWebKit 部分提示需要 ICU。
1 Project ERROR: To build QtWebKit with Qt 5 you need ICU 2 NMAKE : fatal error U1077: 'cd' : return code '0x2' 3 Stop. 4 NMAKE : fatal error U1077: 'D:\Progs\VS9\VC\BIN\nmake.exe' : return code '0x2' 5 Stop. 6 NMAKE : fatal error U1077: 'cd' : return code '0x2' 7 Stop. 8 NMAKE : fatal error U1077: 'D:\Progs\VS9\VC\BIN\nmake.exe' : return code '0x2' 9 Stop. 10 NMAKE : fatal error U1077: '(' : return code '0x2' 11 Stop.
那就下载最新版本的ICU4.9,需要cygwin才能用 VC2008来编译,没有cygwin,多方尝试无果。选择ICU4.4版本来继续。
设置 PATH、INCLUDE、LIB,依然提示错误,应该是 configure 时没有找到吧,直接把检查的语句注释掉后继续。
话说WebKit 实在是奇葩啊,一个 lib 文件居然整了600+M,不可思议。
最后链接生成DLL,居然找不到各种来自WebCore Symbols,实在无语。其实因为 configure 时没有加 -icu 选项,导致没有将 TextBreakIteratorICU.cpp 文件加入到 Makefile 中而出错。可以删除已生成的 Makefile 文件,只重新编译一下 Webkit 部分代码即可。至此,编译总算告一段落。
1 WebCore.lib(visible_units.obj) : error LNK2019: unresolved external symbol "bool __cdecl WebCore::is 2 WordTextBreak(class WebCore::TextBreakIterator *)" (?isWordTextBreak@WebCore@@YA_NPAVTextBreakIterat 3 or@1@@Z) referenced in function "bool __cdecl WebCore::isLogicalStartOfWord(class WebCore::TextBreak 4 Iterator *,int,bool)" (?isLogicalStartOfWord@WebCore@@YA_NPAVTextBreakIterator@1@H_N@Z) 5 WebCore.lib(TouchAdjustment.obj) : error LNK2001: unresolved external symbol "bool __cdecl WebCore:: 6 isWordTextBreak(class WebCore::TextBreakIterator *)" (?isWordTextBreak@WebCore@@YA_NPAVTextBreakIter 7 ator@1@@Z) 8 WebCore.lib(visible_units.obj) : error LNK2019: unresolved external symbol "int __cdecl WebCore::tex 9 tBreakFollowing(class WebCore::TextBreakIterator *,int)" (?textBreakFollowing@WebCore@@YAHPAVTextBre 10 akIterator@1@H@Z) referenced in function "bool __cdecl WebCore::isLogicalStartOfWord(class WebCore:: 11 TextBreakIterator *,int,bool)" (?isLogicalStartOfWord@WebCore@@YA_NPAVTextBreakIterator@1@H_N@Z) 12 WebCore.lib(RenderText.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::textBr 13 eakFollowing(class WebCore::TextBreakIterator *,int)" (?textBreakFollowing@WebCore@@YAHPAVTextBreakI 14 terator@1@H@Z) 15 WebCore.lib(StringTruncator.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::t 16 extBreakFollowing(class WebCore::TextBreakIterator *,int)" (?textBreakFollowing@WebCore@@YAHPAVTextB 17 reakIterator@1@H@Z) 18 WebCore.lib(break_lines.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::textB 19 reakFollowing(class WebCore::TextBreakIterator *,int)" (?textBreakFollowing@WebCore@@YAHPAVTextBreak 20 Iterator@1@H@Z) 21 WebCore.lib(visible_units.obj) : error LNK2019: unresolved external symbol "bool __cdecl WebCore::is 22 TextBreak(class WebCore::TextBreakIterator *,int)" (?isTextBreak@WebCore@@YA_NPAVTextBreakIterator@1 23 @H@Z) referenced in function "bool __cdecl WebCore::isLogicalStartOfWord(class WebCore::TextBreakIte 24 rator *,int,bool)" (?isLogicalStartOfWord@WebCore@@YA_NPAVTextBreakIterator@1@H_N@Z) 25 WebCore.lib(CharacterData.obj) : error LNK2001: unresolved external symbol "bool __cdecl WebCore::is 26 TextBreak(class WebCore::TextBreakIterator *,int)" (?isTextBreak@WebCore@@YA_NPAVTextBreakIterator@1 27 @H@Z) 28 WebCore.lib(StringTruncator.obj) : error LNK2001: unresolved external symbol "bool __cdecl WebCore:: 29 isTextBreak(class WebCore::TextBreakIterator *,int)" (?isTextBreak@WebCore@@YA_NPAVTextBreakIterator 30 @1@H@Z) 31 WebCore.lib(visible_units.obj) : error LNK2019: unresolved external symbol "int __cdecl WebCore::tex 32 tBreakPreceding(class WebCore::TextBreakIterator *,int)" (?textBreakPreceding@WebCore@@YAHPAVTextBre 33 akIterator@1@H@Z) referenced in function "unsigned int __cdecl WebCore::startSentenceBoundary(wchar_ 34 t const *,unsigned int,unsigned int,enum WebCore::BoundarySearchContextAvailability,bool &)" (?start 35 SentenceBoundary@WebCore@@YAIPB_WIIW4BoundarySearchContextAvailability@1@AA_N@Z) 36 WebCore.lib(CharacterData.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::tex 37 tBreakPreceding(class WebCore::TextBreakIterator *,int)" (?textBreakPreceding@WebCore@@YAHPAVTextBre 38 akIterator@1@H@Z) 39 WebCore.lib(RenderText.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::textBr 40 eakPreceding(class WebCore::TextBreakIterator *,int)" (?textBreakPreceding@WebCore@@YAHPAVTextBreakI 41 terator@1@H@Z) 42 WebCore.lib(StringTruncator.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::t 43 extBreakPreceding(class WebCore::TextBreakIterator *,int)" (?textBreakPreceding@WebCore@@YAHPAVTextB 44 reakIterator@1@H@Z) 45 WebCore.lib(visible_units.obj) : error LNK2019: unresolved external symbol "class WebCore::TextBreak 46 Iterator * __cdecl WebCore::sentenceBreakIterator(wchar_t const *,int)" (?sentenceBreakIterator@WebC 47 ore@@YAPAVTextBreakIterator@1@PB_WH@Z) referenced in function "unsigned int __cdecl WebCore::startSe 48 ntenceBoundary(wchar_t const *,unsigned int,unsigned int,enum WebCore::BoundarySearchContextAvailabi 49 lity,bool &)" (?startSentenceBoundary@WebCore@@YAIPB_WIIW4BoundarySearchContextAvailability@1@AA_N@Z 50 ) 51 WebCore.lib(TouchAdjustment.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::t 52 extBreakNext(class WebCore::TextBreakIterator *)" (?textBreakNext@WebCore@@YAHPAVTextBreakIterator@1 53 @@Z) 54 WebCore.lib(visible_units.obj) : error LNK2019: unresolved external symbol "int __cdecl WebCore::tex 55 tBreakNext(class WebCore::TextBreakIterator *)" (?textBreakNext@WebCore@@YAHPAVTextBreakIterator@1@@ 56 Z) referenced in function "unsigned int __cdecl WebCore::endSentenceBoundary(wchar_t const *,unsigne 57 d int,unsigned int,enum WebCore::BoundarySearchContextAvailability,bool &)" (?endSentenceBoundary@We 58 bCore@@YAIPB_WIIW4BoundarySearchContextAvailability@1@AA_N@Z) 59 WebCore.lib(String.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::textBreakN 60 ext(class WebCore::TextBreakIterator *)" (?textBreakNext@WebCore@@YAHPAVTextBreakIterator@1@@Z) 61 WebCore.lib(RenderText.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::textBr 62 eakNext(class WebCore::TextBreakIterator *)" (?textBreakNext@WebCore@@YAHPAVTextBreakIterator@1@@Z) 63 WebCore.lib(TextCheckingHelper.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore 64 ::textBreakNext(class WebCore::TextBreakIterator *)" (?textBreakNext@WebCore@@YAHPAVTextBreakIterato 65 r@1@@Z) 66 WebCore.lib(visible_units.obj) : error LNK2019: unresolved external symbol "class WebCore::TextBreak 67 Iterator * __cdecl WebCore::wordBreakIterator(wchar_t const *,int)" (?wordBreakIterator@WebCore@@YAP 68 AVTextBreakIterator@1@PB_WH@Z) referenced in function "class WebCore::TextBreakIterator * __cdecl We 69 bCore::wordBreakIteratorForMinOffsetBoundary(class WebCore::VisiblePosition const &,class WebCore::I 70 nlineTextBox const *,int &,bool &,class WTF::Vector<wchar_t,1024> &,class WebCore::CachedLogicallyOr 71 deredLeafBoxes &)" (?wordBreakIteratorForMinOffsetBoundary@WebCore@@YAPAVTextBreakIterator@1@ABVVisi 72 blePosition@1@PBVInlineTextBox@1@AAHAA_NAAV?$Vector@_W$0EAA@@WTF@@AAVCachedLogicallyOrderedLeafBoxes 73 @1@@Z) 74 WebCore.lib(RenderText.obj) : error LNK2001: unresolved external symbol "class WebCore::TextBreakIte 75 rator * __cdecl WebCore::wordBreakIterator(wchar_t const *,int)" (?wordBreakIterator@WebCore@@YAPAVT 76 extBreakIterator@1@PB_WH@Z) 77 WebCore.lib(TextCheckingHelper.obj) : error LNK2001: unresolved external symbol "class WebCore::Text 78 BreakIterator * __cdecl WebCore::wordBreakIterator(wchar_t const *,int)" (?wordBreakIterator@WebCore 79 @@YAPAVTextBreakIterator@1@PB_WH@Z) 80 WebCore.lib(TouchAdjustment.obj) : error LNK2001: unresolved external symbol "class WebCore::TextBre 81 akIterator * __cdecl WebCore::wordBreakIterator(wchar_t const *,int)" (?wordBreakIterator@WebCore@@Y 82 APAVTextBreakIterator@1@PB_WH@Z) 83 WebCore.lib(visible_units.obj) : error LNK2019: unresolved external symbol "int __cdecl WebCore::tex 84 tBreakFirst(class WebCore::TextBreakIterator *)" (?textBreakFirst@WebCore@@YAHPAVTextBreakIterator@1 85 @@Z) referenced in function "class WebCore::VisiblePosition __cdecl WebCore::visualWordPosition(clas 86 s WebCore::VisiblePosition const &,enum WebCore::CursorMovementDirection,bool)" (?visualWordPosition 87 @WebCore@@YA?AVVisiblePosition@1@ABV21@W4CursorMovementDirection@1@_N@Z) 88 WebCore.lib(RenderText.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::textBr 89 eakFirst(class WebCore::TextBreakIterator *)" (?textBreakFirst@WebCore@@YAHPAVTextBreakIterator@1@@Z 90 ) 91 WebCore.lib(TouchAdjustment.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore::t 92 extBreakFirst(class WebCore::TextBreakIterator *)" (?textBreakFirst@WebCore@@YAHPAVTextBreakIterator 93 @1@@Z) 94 WebCore.lib(String.obj) : error LNK2019: unresolved external symbol "public: __thiscall WebCore::Non 95 SharedCharacterBreakIterator::~NonSharedCharacterBreakIterator(void)" (??1NonSharedCharacterBreakIte 96 rator@WebCore@@QAE@XZ) referenced in function "unsigned int __cdecl WebCore::numGraphemeClusters(cla 97 ss WTF::String const &)" (?numGraphemeClusters@WebCore@@YAIABVString@WTF@@@Z) 98 WebCore.lib(CharacterData.obj) : error LNK2001: unresolved external symbol "public: __thiscall WebCo 99 re::NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator(void)" (??1NonSharedCharacterB 100 reakIterator@WebCore@@QAE@XZ) 101 WebCore.lib(StringTruncator.obj) : error LNK2001: unresolved external symbol "public: __thiscall Web 102 Core::NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator(void)" (??1NonSharedCharacte 103 rBreakIterator@WebCore@@QAE@XZ) 104 WebCore.lib(String.obj) : error LNK2019: unresolved external symbol "public: __thiscall WebCore::Non 105 SharedCharacterBreakIterator::NonSharedCharacterBreakIterator(wchar_t const *,int)" (??0NonSharedCha 106 racterBreakIterator@WebCore@@QAE@PB_WH@Z) referenced in function "unsigned int __cdecl WebCore::numG 107 raphemeClusters(class WTF::String const &)" (?numGraphemeClusters@WebCore@@YAIABVString@WTF@@@Z) 108 WebCore.lib(CharacterData.obj) : error LNK2001: unresolved external symbol "public: __thiscall WebCo 109 re::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(wchar_t const *,int)" (??0NonSh 110 aredCharacterBreakIterator@WebCore@@QAE@PB_WH@Z) 111 WebCore.lib(StringTruncator.obj) : error LNK2001: unresolved external symbol "public: __thiscall Web 112 Core::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(wchar_t const *,int)" (??0Non 113 SharedCharacterBreakIterator@WebCore@@QAE@PB_WH@Z) 114 WebCore.lib(String.obj) : error LNK2019: unresolved external symbol "int __cdecl WebCore::textBreakC 115 urrent(class WebCore::TextBreakIterator *)" (?textBreakCurrent@WebCore@@YAHPAVTextBreakIterator@1@@Z 116 ) referenced in function "unsigned int __cdecl WebCore::numCharactersInGraphemeClusters(class WTF::S 117 tring const &,unsigned int)" (?numCharactersInGraphemeClusters@WebCore@@YAIABVString@WTF@@I@Z) 118 WebCore.lib(TextCheckingHelper.obj) : error LNK2001: unresolved external symbol "int __cdecl WebCore 119 ::textBreakCurrent(class WebCore::TextBreakIterator *)" (?textBreakCurrent@WebCore@@YAHPAVTextBreakI 120 terator@1@@Z) 121 WebCore.lib(RenderText.obj) : error LNK2019: unresolved external symbol "class WebCore::TextBreakIte 122 rator * __cdecl WebCore::cursorMovementIterator(wchar_t const *,int)" (?cursorMovementIterator@WebCo 123 re@@YAPAVTextBreakIterator@1@PB_WH@Z) referenced in function "public: virtual int __thiscall WebCore 124 ::RenderText::previousOffset(int)const " (?previousOffset@RenderText@WebCore@@UBEHH@Z) 125 WebCore.lib(RenderText.obj) : error LNK2019: unresolved external symbol "void __cdecl WebCore::relea 126 seLineBreakIterator(class WebCore::TextBreakIterator *)" (?releaseLineBreakIterator@WebCore@@YAXPAVT 127 extBreakIterator@1@@Z) referenced in function "public: __thiscall WebCore::LazyLineBreakIterator::~L 128 azyLineBreakIterator(void)" (??1LazyLineBreakIterator@WebCore@@QAE@XZ) 129 WebCore.lib(RenderBlockLineLayout.obj) : error LNK2001: unresolved external symbol "void __cdecl Web 130 Core::releaseLineBreakIterator(class WebCore::TextBreakIterator *)" (?releaseLineBreakIterator@WebCo 131 re@@YAXPAVTextBreakIterator@1@@Z) 132 WebCore.lib(break_lines.obj) : error LNK2019: unresolved external symbol "class WebCore::TextBreakIt 133 erator * __cdecl WebCore::acquireLineBreakIterator(wchar_t const *,int,class WTF::AtomicString const 134 &)" (?acquireLineBreakIterator@WebCore@@YAPAVTextBreakIterator@1@PB_WHABVAtomicString@WTF@@@Z) refe 135 renced in function "public: class WebCore::TextBreakIterator * __thiscall WebCore::LazyLineBreakIter 136 ator::get(void)" (?get@LazyLineBreakIterator@WebCore@@QAEPAVTextBreakIterator@2@XZ) 137 ..\lib\QtWebKit5.dll : fatal error LNK1120: 14 unresolved externals 138 NMAKE : fatal error U1077: 'D:\Progs\VS9\VC\BIN\link.EXE' : return code '0x460' 139 Stop. 140 NMAKE : fatal error U1077: 'D:\Progs\VS9\VC\BIN\nmake.exe' : return code '0x2' 141 Stop. 142 NMAKE : fatal error U1077: '(' : return code '0x2' 143 Stop. 144 NMAKE : fatal error U1077: 'cd' : return code '0x2' 145 Stop. 146 147 ===== BUILD FAILED ====== 148 149 The build failed with exit code 2. This may have been because you 150 151 - added an #include to a source/header 152 - added a Q_OBJECT macro to a class 153 - added a new resource to a qrc file 154 155 as dependencies are not automatically re-computed for local developer builds. 156 You may try computing dependencies manually by running 'make qmake' in: 157 158 D:\qt-everywhere-opensource-src-5.0.0-beta1\qtwebkit\WebKitBuild\Release 159 160 or passing --makeargs="qmake" to build-webkit. 161 162 ========================= 163 164 NMAKE : fatal error U1077: 'cd' : return code '0x2' 165 Stop. 166 NMAKE : fatal error U1077: 'D:\Progs\VS9\VC\BIN\nmake.exe' : return code '0x2' 167 Stop. 168 NMAKE : fatal error U1077: '(' : return code '0x2' 169 Stop.