Compiling Webkit on Windows using Visual Studio 2012

Just some notes on compiling WebKit on windows with visual studio.

Issues :

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xrefwrap(431): error C2064: term does not evaluate to a function taking 1 arguments (..\..\win\WebCoreSupport\WebFrameLoaderClient.cpp)
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(239) : see reference to function template instantiation '_Ret std::_Callable_obj<_Ty>::_ApplyX<_Rx,WebCore::PolicyAction>(_V0_t &&)' being compiled
25>          with
25>          [
25>              _Ret=void,
25>              _Ty=int,
25>              _Rx=void,
25>              _V0_t=WebCore::PolicyAction
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(239) : see reference to function template instantiation '_Ret std::_Callable_obj<_Ty>::_ApplyX<_Rx,WebCore::PolicyAction>(_V0_t &&)' being compiled
25>          with
25>          [
25>              _Ret=void,
25>              _Ty=int,
25>              _Rx=void,
25>              _V0_t=WebCore::PolicyAction
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(239) : while compiling class template member function 'void std::_Func_impl<_Callable,_Alloc,_Rx,_V0_t>::_Do_call(_V0_t &&)'
25>          with
25>          [
25>              _Callable=_MyWrapper,
25>              _Alloc=std::allocator>,
25>              _Rx=void,
25>              _V0_t=WebCore::PolicyAction
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(515) : see reference to class template instantiation 'std::_Func_impl<_Callable,_Alloc,_Rx,_V0_t>' being compiled
25>          with
25>          [
25>              _Callable=_MyWrapper,
25>              _Alloc=std::allocator>,
25>              _Rx=void,
25>              _V0_t=WebCore::PolicyAction
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(515) : see reference to function template instantiation 'void std::_Func_class<_Ret,_V0_t>::_Do_alloc<_Myimpl,_Ty,_Alloc>(_Fty &&,_Alloc)' being compiled
25>          with
25>          [
25>              _Ret=void,
25>              _V0_t=WebCore::PolicyAction,
25>              _Ty=int,
25>              _Alloc=std::allocator>,
25>              _Fty=int
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(515) : see reference to function template instantiation 'void std::_Func_class<_Ret,_V0_t>::_Do_alloc<_Myimpl,_Ty,_Alloc>(_Fty &&,_Alloc)' being compiled
25>          with
25>          [
25>              _Ret=void,
25>              _V0_t=WebCore::PolicyAction,
25>              _Ty=int,
25>              _Alloc=std::allocator>,
25>              _Fty=int
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(515) : see reference to function template instantiation 'void std::_Func_class<_Ret,_V0_t>::_Reset_alloc<_Ty,std::allocator>>(_Fty &&,_Alloc)' being compiled
25>          with
25>          [
25>              _Ret=void,
25>              _V0_t=WebCore::PolicyAction,
25>              _Ty=int,
25>              _Fty=int,
25>              _Alloc=std::allocator>
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(515) : see reference to function template instantiation 'void std::_Func_class<_Ret,_V0_t>::_Reset_alloc<_Ty,std::allocator>>(_Fty &&,_Alloc)' being compiled
25>          with
25>          [
25>              _Ret=void,
25>              _V0_t=WebCore::PolicyAction,
25>              _Ty=int,
25>              _Fty=int,
25>              _Alloc=std::allocator>
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(675) : see reference to function template instantiation 'void std::_Func_class<_Ret,_V0_t>::_Reset<_Ty>(_Fty &&)' being compiled
25>          with
25>          [
25>              _Ret=void,
25>              _V0_t=WebCore::PolicyAction,
25>              _Ty=int,
25>              _Fty=int
25>          ]
25>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(675) : see reference to function template instantiation 'void std::_Func_class<_Ret,_V0_t>::_Reset<_Ty>(_Fty &&)' being compiled
25>          with
25>          [
25>              _Ret=void,
25>              _V0_t=WebCore::PolicyAction,
25>              _Ty=int,
25>              _Fty=int
25>          ]
25>          ..\..\win\WebCoreSupport\WebFrameLoaderClient.cpp(97) : see reference to function template instantiation 'std::function<_Fty>::function(_Fx &&)' being compiled
25>          with
25>          [
25>              _Fty=void (WebCore::PolicyAction),
25>              _Fx=int
25>          ]
25>          ..\..\win\WebCoreSupport\WebFrameLoaderClient.cpp(97) : see reference to function template instantiation 'std::function<_Fty>::function(_Fx &&)' being compiled
25>          with
25>          [
25>              _Fty=void (WebCore::PolicyAction),
25>              _Fx=int
25>          ]

Patch
WebFrameLoaderClient.cpp
Line 97
– : m_policyFunction(0)
+ : m_policyFunction(nullptr)

Issue:

25>WebKitGUID.lib(WebKit_i.obj) : error LNK2005: _IID_IDOMDocumentType already defined in uuid.lib(i_mshtml.obj)
25>WebKitGUID.lib(WebKit_i.obj) : error LNK2005: _IID_IDOMProcessingInstruction already defined in uuid.lib(i_mshtml.obj)
25>WebKitGUID.lib(WebKit_i.obj) : error LNK2005: _IID_IDOMEvent already defined in uuid.lib(i_mshtml.obj)
25>WebKitGUID.lib(WebKit_i.obj) : error LNK2005: _IID_IDOMUIEvent already defined in uuid.lib(i_mshtml.obj)
25>WebKitGUID.lib(WebKit_i.obj) : error LNK2005: _IID_IDOMKeyboardEvent already defined in uuid.lib(i_mshtml.obj)
25>WebKitGUID.lib(WebKit_i.obj) : error LNK2005: _IID_IDOMMouseEvent already defined in uuid.lib(i_mshtml.obj)
25>WebKitGUID.lib(WebKit_i.obj) : error LNK2005: _IID_IDOMMutationEvent already defined in uuid.lib(i_mshtml.obj)
25>WebKitGUID.lib(WebKit_i.obj) : error LNK2005: _IID_IDOMWheelEvent already defined in uuid.lib(i_mshtml.obj)

Added linker option to WebKitGUID /FORCE:MULTIPLE
Now we get warning instead of errors;

13>WebKitGUID.lib(WebKit_i.obj) : warning LNK4006: _IID_IDOMDocumentType already defined in uuid.lib(i_mshtml.obj); second definition ignored
13>WebKitGUID.lib(WebKit_i.obj) : warning LNK4006: _IID_IDOMProcessingInstruction already defined in uuid.lib(i_mshtml.obj); second definition ignored
13>WebKitGUID.lib(WebKit_i.obj) : warning LNK4006: _IID_IDOMEvent already defined in uuid.lib(i_mshtml.obj); second definition ignored
13>WebKitGUID.lib(WebKit_i.obj) : warning LNK4006: _IID_IDOMUIEvent already defined in uuid.lib(i_mshtml.obj); second definition ignored
13>WebKitGUID.lib(WebKit_i.obj) : warning LNK4006: _IID_IDOMKeyboardEvent already defined in uuid.lib(i_mshtml.obj); second definition ignored
13>WebKitGUID.lib(WebKit_i.obj) : warning LNK4006: _IID_IDOMMouseEvent already defined in uuid.lib(i_mshtml.obj); second definition ignored
13>WebKitGUID.lib(WebKit_i.obj) : warning LNK4006: _IID_IDOMMutationEvent already defined in uuid.lib(i_mshtml.obj); second definition ignored
13>WebKitGUID.lib(WebKit_i.obj) : warning LNK4006: _IID_IDOMWheelEvent already defined in uuid.lib(i_mshtml.obj); second definition ignored
13>C:\cygwin\home\gbugaj\WebKit\WebKitBuild\Debug_WinCairo\bin32\WebKit.dll : warning LNK4088: image being generated due to /FORCE option; image may not run

Building Dependencies

Cairo

Issue

gbugaj@LTRMS7GB /cygdrive/c/cygwin/home/gbugaj/cairo
$ make -f Makefile.win32  CFG=release

make[1]: Entering directory '/cygdrive/c/cygwin/home/gbugaj/cairo/src'

cairo-deflate-stream.c
e:\source\c-libraries\zlib-1.2.3-lib\include\zconf.h(289) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
../build/Makefile.win32.common:55: recipe for target 'release/cairo-deflate-stream.obj' failed
make[1]: *** [release/cairo-deflate-stream.obj] Error 2
make[1]: Leaving directory '/cygdrive/c/cygwin/home/gbugaj/cairo/src'
Makefile.win32:12: recipe for target 'cairo' failed
make: *** [cairo] Error 2

Fix is to add empty ‘unistd.h’ to zlib include directory

Leave a Comment

Your email address will not be published. Required fields are marked *