0

I am trying to build Qt 4.8.6 as a x64 static library by Visual Studio 2013 SP5 with webkit included, but I get this error after a few minutes of running nmake:

Generating Code...
        lib /NOLOGO  /OUT:..\..\lib\QtDeclarative.lib @C:\Users\Siavash\AppData\Local\Temp\nm3EA3.tmp qdeclarativeevents.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library qlistmodelinterface.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
        cd src\3rdparty\webkit\Source\ && C:\MSVS2013\VC\BIN\nmake.exe -f Makefile.WebKit

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 Copyright (C) Microsoft Corporation.  All rights reserved.

        cd JavaScriptCore\ && C:\MSVS2013\VC\BIN\nmake.exe -f Makefile.WebKit

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 Copyright (C) Microsoft Corporation.  All rights reserved.

        c:\Qt\4.8.6\bin\qmake.EXE -o Makefile.WebKit JavaScriptCore.pro
        C:\MSVS2013\VC\BIN\nmake.exe -f Makefile.WebKit.Release

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -c -nologo -Zm200 -Zc:wchar_t- -FS -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996 -O2 -MD -GR -EHsc -DUNICODE -DWIN32 -DNDEBUG -DBUILDING_QT__=1 -DNDEBUG -DQT_ASCII_CAST_WARNINGS -D_HAS_TR1=0 -DBUILDING_JavaScriptCore -DBUILDING_WTF -DQT_NO_DEBUG -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"..\..\Source" -I"..\ThirdParty" -I"assembler" -I"bytecode" -I"bytecompiler" -I"heap" -I"dfg" -I"debugger" -I"interpreter" -I"jit" -I"parser" -I"profiler" -I"runtime" -I"wtf" -I"wtf\gobject" -I"c:\Qt\4.8.6\src\3rdparty\webkit\Source\JavaScriptCore\wtf\symbian" -I"wtf\unicode" -I"yarr" -I"API" -I"ForwardingHeaders" -I"generated" -I"os-win32" -I"..\..\Source" -I"..\..\include" -I"\include\QtWebKit" -I"\include" -I"..\..\..\..\..\include\ActiveQt" -I"tmp\moc\release_static" -I"..\..\..\..\..\mkspecs\win32-msvc2013" -Fotmp\obj\release_static\ @C:\Users\Siavash\AppData\Local\Temp\nm4880.tmp DateMath.cpp 
.\wtf/MathExtras.h(117) : error C2491: 'round' : definition of dllimport function not allowed
.\wtf/MathExtras.h(124) : error C2491: 'roundf' : definition of dllimport function not allowed 
.\wtf/MathExtras.h(146) : error C2084: function 'bool signbit(double)' already has a body
        C:\MSVS2013\VC\INCLUDE\math.h(324) : see previous definition of 'signbit'
        c:\qt\4.8.6\src\3rdparty\webkit\source\javascriptcore\runtime\JSValueInlineMethods.h(168) : error C2264: 'signbit' : error in function definition or declaration; function not called dtoa.cpp
.\wtf/MathExtras.h(117) : error C2491: 'round' : definition of dllimport function not allowed
.\wtf/MathExtras.h(124) : error C2491: 'roundf' : definition of dllimport function not allowed           
.\wtf/MathExtras.h(146) : error C2084: function 'bool signbit(double)' already has a body
        C:\MSVS2013\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' DecimalNumber.cpp 
.\wtf/MathExtras.h(117) : error C2491: 'round' : definition of dllimport function not allowed 
.\wtf/MathExtras.h(124) : error C2491: 'roundf' : definition of dllimport function not allowed 
.\wtf/MathExtras.h(146) : error C2084: function 'bool signbit(double)' already has a body
        C:\MSVS2013\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' Generating Code... 
    NMAKE : fatal error U1077: 'C:\MSVS2013\VC\BIN\x86_amd64\cl.EXE' : return code '0x2' Stop. 
    NMAKE : fatal error U1077: 'C:\MSVS2013\VC\BIN\nmake.exe' : return code '0x2' Stop. 
    NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.

This problem does not exist when I do not explicitly configure qt to build webkit, which will not be built otherwise, even if it is a default option. Also this is the configuration that I use:

configure -opensource -release -static -webkit -platform win32-msvc2013

I understand my problem might be similar to this one, but because Visual Studio 2013 is supported by Qt 4.8.6 I think this problem has a different reason. Furthermore, I have tried moving all of the necessary packages and even reinstalling VS to ensure that the PATHs that I use do not include any spaces or are not "too long". I have searched through so many guides and posts but nothing seems to help me with this. Is there something that I might be missing?

Community
  • 1
  • 1
Siav Josep
  • 130
  • 2
  • 10
  • 1
    Qt does not support statically linked webkit/webengine. You need to modify webkit's source to get it to build in a static build. I'm not sure offhand how easy of a job it is. – Kuba hasn't forgotten Monica Aug 23 '16 at 21:33
  • @KubaOber, Web building a shared library it becomes a huge pain gathering up the required runtime `.dll`s into the directory. Also, sometimes my build generates the libraries with the version at the end of the file names, are they any different from the ones without them? (i.e `QtWebkit4.dll` vs `QtWebkit.dll`) – Siav Josep Aug 23 '16 at 22:06
  • I don't know what your build procedure is, but obviously it's not repeatable and you need to fix that first. As a consolation, you can build Qt that is linked to the static runtime. It's easier with Qt 5, but even for Qt 4 all it takes is a slight modification of spec files to choose a proper runtime. That way you'll only need Qt dlls and not MSVC runtime dlls. That's a good tradeoff I think. – Kuba hasn't forgotten Monica Aug 24 '16 at 13:31
  • Finally, your build should be set up so that you end up with an application installer. So I don't see how it's a "pain" to gather runtime dll requirements: a script will do it for you. You set it up once and you're done. Finally, your top-level build should start with a clean slate: download Qt, build Qt, then build your application - all on a machine that has nothing else installed but Windows and MSVC2013. – Kuba hasn't forgotten Monica Aug 24 '16 at 13:32
  • If you're doing any of these steps manually in production, you're doing it wrong, and you'll suffer endlessly for it. Automate it all you must. – Kuba hasn't forgotten Monica Aug 24 '16 at 13:33

0 Answers0