2012-02-19 91 views
1

我開始了一個平分qtwebkit,當我在第一階段嘗試編譯它時,它給了我以下例外。我嘗試使用舊的qmake,但它仍然給出相同的例外。這實際上意味着什麼,我該如何解決它。編譯qt-webkit和mingw32-make for bisecting

g++ -c -Wall -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DBUILDING_QT__=1 -DWTF_USE_ACCELERATED_COMPOSITING -DUSE_SYSTEM_MALLOC -DNDEBUG -D_HAS_TR1=0 -DBUILDING_QT__ -DBUILDING_JavaScriptCore -DBUILDING_WTF -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include" -I"." -I"..\..\webkit" -I"assembler" -I"bytecode" -I"bytecompiler" -I"debugger" -I"interpreter" -I"jit" -I"parser" -I"pcre" -I"profiler" -I"runtime" -I"wtf" -I"wtf\symbian" -I"wtf\unicode" -I"yarr" -I"API" -I"ForwardingHeaders" -I"generated" -I"\include\QtWebKit" -I"pcre" -I"\JavaScriptCore\tmp" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"c:\QtSDK1.2\mingw\include" -I"c:\QtSDK1.2\mingw\include" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\MainThreadQt.o wtf\qt\MainThreadQt.cpp In file included from wtf\qt\MainThreadQt.cpp:72: 
tmp\moc\debug_shared/MainThreadQt.moc:13:2: error: #error "This file was generated using the moc from 4.8.0. It" 
tmp\moc\debug_shared/MainThreadQt.moc:14:2: error: #error "cannot be used with the include files from this version of Qt." 
tmp\moc\debug_shared/MainThreadQt.moc:15:2: error: #error "(The moc has changed too much.)" 
In file included from wtf\qt\MainThreadQt.cpp:72: 
tmp\moc\debug_shared/MainThreadQt.moc:42: error: no 'void WTF::MainThreadInvoker::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)' member function declared in class 'WTF::MainThreadInvoker' 
tmp\moc\debug_shared/MainThreadQt.moc:55: error: 'const QMetaObjectExtraData WTF::MainThreadInvoker::staticMetaObjectExtraData' is not a static member of 'class WTF::MainThreadInvoker' 
tmp\moc\debug_shared/MainThreadQt.moc:56: error: 'qt_static_metacall' was not declared in this scope 
tmp\moc\debug_shared/MainThreadQt.moc:57: error: too many initializers for 'const QMetaObjectExtraData' 
tmp\moc\debug_shared/MainThreadQt.moc:61: error: 'staticMetaObjectExtraData' was not declared in this scope 
tmp\moc\debug_shared/MainThreadQt.moc:62: error: too many initializers for 'QMetaObject::<anonymous struct>' 
tmp\moc\debug_shared/MainThreadQt.moc: In member function 'virtual int WTF::MainThreadInvoker::qt_metacall(QMetaObject::Call, int, void**)': 
tmp\moc\debug_shared/MainThreadQt.moc:88: error: 'qt_static_metacall' was not declared in this scope 
mingw32-make[2]: *** [tmp/obj/debug_shared/MainThreadQt.o] Error 1 
mingw32-make[2]: Leaving directory `C:/Qt/qtGITSource/qt/src/3rdparty/webkit/JavaScriptCore' 
mingw32-make[1]: *** [debug-all] Error 2 
mingw32-make[1]: Leaving directory `C:/Qt/qtGITSource/qt/src/3rdparty/webkit/JavaScriptCore' 
mingw32-make: *** [sub-JavaScriptCore-make_default-ordered] Error 2 

回答

0

恕我直言ll。 2,3是很重要的:

錯誤「此文件是使用MOC從4.8.0生成它。」

錯誤「無法與從這個版本的Qt的包含文件中。」

您的版本低於qt 4.8,並且所有的moc文件都是在moc v4.8以前的版本中生成的。你必須清理你的編譯目錄並重新啓動你的編譯命令(確保你使用了恰當版本的qmake,moc等)。

+0

非常感謝您的回覆。我確實運行了mingw32,使其清理項目,但它似乎沒有幫助我。在錯誤中提到了tmp \ moc \ debug_shared/MainThreadQt.moc文件,但它不存在。我也嘗試使用4.7.4的qmake。但它最終給了我同樣的錯誤。我真的很感謝你的回答。 – Tharanga 2012-02-20 05:29:01

+0

你使用哪個git提交qt? (哪個提交導致這個問題?)你在Windows上編譯還是你想交叉編譯? – sgibb 2012-02-20 16:36:08

+0

我正在使用qt4.8並試圖向後建立。我認爲我在那裏做錯了。我不得不從一開始就構建它,而不是隻構建一個組件,這是qtwebkit。 – Tharanga 2012-02-21 08:35:53