在Windows Qt-4.8.x平台上編譯Qt-5.0+ WebKit(即qtwebkit-2.3.x) Debug版注意事項

來源:互聯網
上載者:User

標籤:嵌入式   vs2010   項目組態管理   

在Windows Qt-4.8.x平台上編譯Qt-5.0+ WebKit(即qtwebkit-2.3.x) Debug版注意事項跳轉至: 導航、 搜尋
目錄
  • 1C++編譯問題
    • 1.1從idl產生.h/.cpp失敗?
    • 1.2VS編譯器版本
    • 1.3名字匯出問題
    • 1.4找不到int64_t類型?
    • 1.5Windows上需要pthread-win32庫以提供多線程支援
  • 2連結問題
    • 2.1mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "..\lib\QtWebKitd.dll"
    • 2.2LINK : fatal error LNK1181: cannot open input file ‘d:\qt-everywhere-opensource-src-4.8.4\lib\QtSqld4.lib‘
    • 2.3確認QtTestBrowser項目連結的不是Qt內部的WebKit lib
    • 2.4注意Windows與Linux對lib的連結依賴差別
    • 2.5Windows上沒有xlib plugins,刪除對應引用
    • 2.6debug\WebCored.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x40EB50B4
C++編譯問題前提條件!!需要安裝GNUWin32軟體(主要是Flex及Bison、gperf)及pthread-win32。從idl產生.h/.cpp失敗?
  1. 確保不要使用cygin裡的perl和bison等程式,使用外部的Perl(我用的是5.16)和GnuWin32裡的bison
VS編譯器版本
  1. 請使用VS2010以上,不要再用VS2008(VS2005更加過時了),否則最終連結lib時會遇到錯誤:
名字匯出問題
  1. QtWebKit.dll其實由下面幾個子項目構成:
    1. WTF
    2. JavaScriptCore
    3. WebCore
    4. WebKit(2)
    5. QtWebKit(API)
    請為這幾個項目一律添加下列預定義宏:BUILDING_WTF、BUILDING_JavaScriptCore、BUILDING_WebCore、BUILDING_WEBKIT
    同時需要修改Source\JavaScriptCore\config.h,確保#include "JSExportMacros.h"
找不到int64_t類型?
  1. 在對應的cpp(或直接修改config.h)中添加://需要把-I"..\..\..\Source\JavaScriptCore\os-win32"加入項目包含路徑
    #if OS(WINDOWS) && COMPILER(MSVC)
    #include "stdint.h"
    #endif
Windows上需要pthread-win32庫以提供多線程支援

直接使用先行編譯好的pthreads-win32-2.8.0即可

連結問題 mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "..\lib\QtWebKitd.dll"

殺毒軟體的問題,刪除dll,重新Build

LINK : fatal error LNK1181: cannot open input file ‘d:\qt-everywhere-opensource-src-4.8.4\lib\QtSqld4.lib‘
  1. 遇到這種問題比較容易解決,說明WebKit代碼需要連結QtSqld庫,開啟Qt的projects.sln,選擇對應模組,Build即可
確認QtTestBrowser項目連結的不是Qt內部的WebKit lib
  1. 檢查對應的Makefile或VS的linker input設定
  2. 注意,WebKit官方壓縮包附帶的是QtTestBrowser,而Qt本身附帶的是demos/browser和fancy browser
注意Windows與Linux對lib的連結依賴差別

Windows上編譯QtWebKit時,刪除對fontconfig.lib、qxlibd.lib的連結依賴

Windows上沒有xlib plugins,刪除對應引用
  1. error LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_xlib(void)" ([email protected]@[email protected]@XZ) referenced in function "public: __thiscall StaticxlibPluginInstance::StaticxlibPluginInstance(void)" ([email protected]@[email protected])
  2. 修改Tools\QtTestBrowser\main.cpp,刪除Q_IMPORT_PLUGIN(xlib)行
debug\WebCored.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x40EB50B4
  1. 某些情況下,刪除*.lib、*.dll、*.exp、*.pdb,重新Build,可以成功
  2. 實在不行,說明必須使用VS2010+,VS2008-已經過時了 

在Windows Qt-4.8.x平台上編譯Qt-5.0+ WebKit(即qtwebkit-2.3.x) Debug版注意事項

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.