Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Errors trying to build Qt 5.4.1 with WebKit on Windows



  • I am trying to build Qt 5.4.1 with WebKit on Windows (using Visual Studio 2013), which I understand requires ICU. I run configure like this:

    configure.bat -I C:/my_inc -L c:/my_lib -debug-and-release -qt-zlib -icu -opensource -prefix c:/my_prefix -nomake tests -nomake examples 
    

    Having built ICU, I found that Qt was trying to link its debug build with the release version of ICU, so I made this change:

    --- /c/Users/mcdanb/Source/qt-everywhere-opensource-src-5.4.1/qtbase/src/corelib/tools/tools.pri	Mon Feb 16 23:56:49 2015
    +++ qtbase/src/corelib/tools/tools.pri	Fri Apr  3 16:52:29 2015
    @@ -165,7 +165,11 @@
                     LIBS_PRIVATE += -lsicuin -lsicuuc -lsicudt
                 }
             } else {
    -            LIBS_PRIVATE += -licuin -licuuc -licudt
    +            CONFIG(debug, debug|release) {
    +                LIBS_PRIVATE += -licuind -licuucd -licudtd
    +            } else {
    +                LIBS_PRIVATE += -licuin -licuuc -licudt
    +            )
             }
         } else {
             LIBS_PRIVATE += -licui18n -licuuc -licudata
    

    Next, I found that QT_USE_ICU seemed not to be defined when building corelib/codecs and I did this:

    --- /c/Users/mcdanb/Source/qt-everywhere-opensource-src-5.4.1/qtbase/src/corelib/codecs/codecs.pri	Mon Feb 16 23:56:50 2015
    +++ qtbase/src/corelib/codecs/codecs.pri	Mon Apr  6 11:26:23 2015
    @@ -20,6 +20,7 @@
             codecs/qicucodec_p.h
         SOURCES += \
             codecs/qicucodec.cpp
    +    DEFINES += QT_USE_ICU
     } else {
         HEADERS += \
             codecs/qsimplecodec_p.h \
    

    Now, the Qt5Cored.dll build doesn't appear to be pulling in all the object files it needs:

    	link /NOLOGO /DYNAMICBASE /NXCOMPAT /BASE:0x67000000 /DEBUG /DLL /SUBSYSTEM:WINDOWS /VERSION:5.41 /MANIFEST:embed /OUT:..\..\lib\Qt5Cored.dll @C:\Users\mcdanb\AppData\Local\Temp\nmBFD4.tmp
       Creating library ..\..\lib\Qt5Cored.lib and object ..\..\lib\Qt5Cored.exp
    moc_qabstractitemmodel.obj : error LNK2001: unresolved external symbol "public: static struct QArrayData * __cdecl QArrayData::allocate(unsigned __int64,unsigned __int64,unsigned __int64,class QFlags<enum QArrayData::AllocationOption>)" (?allocate@QArrayData@@SAPEAU1@_K00V?$QFlags@W4AllocationOption@QArrayData@@@@@Z)
    moc_qstringlistmodel.obj : error LNK2001: unresolved external symbol "public: static struct QArrayData * __cdecl QArrayData::allocate(unsigned __int64,unsigned __int64,unsigned __int64,class QFlags<enum QArrayData::AllocationOption>)" (?allocate@QArrayData@@SAPEAU1@_K00V?$QFlags@W4AllocationOption@QArrayData@@@@@Z)
    moc_qeventdispatcher_win_p.obj : error LNK2001: unresolved external symbol "public: static struct QArrayData * __cdecl QArrayData::allocate(unsigned __int64,unsigned __int64,unsigned __int64,class QFlags<enum QArrayData::AllocationOption>)" (?allocate@QArrayData@@SAPEAU1@_K00V?$QFlags@W4AllocationOption@QArrayData@@@@@Z)
    [...and many more]
    

    Can anyone suggest what needs to be fixed here? Does anyone have a recipe for building Qt with WebKit on Windows that works with 5.4.1?