movableink / webkit

Unofficial mirror of the WebKit SVN repository
http://www.webkit.org/
59 stars 11 forks source link

Undefined references on WTF.lib #30

Closed aquiles2k closed 6 months ago

aquiles2k commented 6 months ago

When building on msvc i get the following:

19>Target Link:
19>     Creating library D:/Dev/Builds/qtwebkitcmake/lib/Release/jsc.lib and object D:/Dev/Builds/qtwebkitcmake/lib/Release/jsc.exp
19>  WTF.lib(WorkQueue.obj) : error LNK2001: unresolved external symbol "public: virtual void __cdecl WTF::WorkQueueBase::dispatch(class WTF::Function<void __cdecl(void)> &&)" (?dispatch@WorkQueueBase@WTF@@UEAAX$$QEAV?$Function@$$A6AXXZ@2@@Z)
19>  WTF.lib(WorkQueue.obj) : error LNK2001: unresolved external symbol "public: virtual void __cdecl WTF::WorkQueueBase::dispatchAfter(class WTF::Seconds,class WTF::Function<void __cdecl(void)> &&)" (?dispatchAfter@WorkQueueBase@WTF@@UEAAXVSeconds@2@$$QEAV?$Function@$$A6AXXZ@2@@Z)
19>  WTF.lib(WorkQueue.obj) : error LNK2019: unresolved external symbol "protected: void __cdecl WTF::WorkQueueBase::platformInitialize(char const *,enum WTF::WorkQueueBase::Type,enum WTF::Thread::QOS)" (?platformInitialize@WorkQueueBase@WTF@@IEAAXPEBDW4Type@12@W4QOS@Thread@2@@Z) referenced in function "protected: __cdecl WTF::WorkQueueBase::WorkQueueBase(char const *,enum WTF::WorkQueueBase::Type,enum WTF::Thread::QOS)" (??0WorkQueueBase@WTF@@IEAA@PEBDW4Type@01@W4QOS@Thread@1@@Z)
19>  WTF.lib(WorkQueue.obj) : error LNK2019: unresolved external symbol "protected: void __cdecl WTF::WorkQueueBase::platformInvalidate(void)" (?platformInvalidate@WorkQueueBase@WTF@@IEAAXXZ) referenced in function "public: virtual __cdecl WTF::WorkQueueBase::~WorkQueueBase(void)" (??1WorkQueueBase@WTF@@UEAA@XZ)
19>  WTF.lib(WorkQueue.obj) : error LNK2019: unresolved external symbol "private: static class WTF::Ref<class WTF::WorkQueue,struct WTF::RawPtrTraits<class WTF::WorkQueue> > __cdecl WTF::WorkQueue::constructMainWorkQueue(void)" (?constructMainWorkQueue@WorkQueue@WTF@@CA?AV?$Ref@VWorkQueue@WTF@@U?$RawPtrTraits@VWorkQueue@WTF@@@2@@2@XZ) referenced in function "public: static class WTF::WorkQueue & __cdecl WTF::WorkQueue::main(void)" (?main@WorkQueue@WTF@@SAAEAV12@XZ)
19>  D:\Dev\Builds\qtwebkitcmake\bin\Release\jsc.exe : fatal error LNK1120: 5 unresolved externals
19>Done building target "Link" in project "jsc.vcxproj" -- FAILED.
19>
19>Done building project "jsc.vcxproj" -- FAILED.

Perhaps someone else came along these and has a quick fix?

It might be related to this fix in webkit and my following patch: https://bugs.webkit.org/show_bug.cgi?id=210785

diff --git a/Source/WTF/wtf/PlatformQt.cmake b/Source/WTF/wtf/PlatformQt.cmake
index 1111111..2222222 100644
--- a/Source/WTF/wtf/PlatformQt.cmake
+++ b/Source/WTF/wtf/PlatformQt.cmake
@@ -108,7 +108,6 @@
 if (WIN32)
     list(APPEND WTF_SOURCES
         win/CPUTimeWin.cpp
-        win/WorkQueueWin.cpp
     )
     list(APPEND WTF_LIBRARIES
         winmm
mnutt commented 6 months ago

There's a fairly common pattern in webkit where there are platform-generic header definitions, and then each platform implements the method in a platform-specific file.

Maybe try what they did upstream, replacing win/WorkQueueWin.cpp there with generic/WorkQueueGeneric.cpp?

quarcko commented 6 months ago

That's correct. and also you will need another source file there:

generic/WorkQueueGeneric.cpp win/SignalsWin.cpp

aquiles2k commented 6 months ago

Thanks! I figured out the missing WorkQueueGeneric.cpp yesterday, just had no time to update the ticket yet.

@quarcko Haven't yet stumbled over SignalsWin.cpp, perhaps its needed further down the compilation line or just for qt6 build? But good to know!