RESOLVED FIXED Bug 56723
[Qt] Linking error when tryng to build Qt Webkit on Windows
https://bugs.webkit.org/show_bug.cgi?id=56723
Summary [Qt] Linking error when tryng to build Qt Webkit on Windows
Nancy Piedra
Reported 2011-03-20 05:21:24 PDT
Created attachment 86281 [details] Windows XP linking errors When trying to build Qt Webkit on Windows XP using MinGW, I get linking errors. I've attached the error output. I looked through exiting bugs and didn't see one for this. I followed the instruction here and built using MinGW: http://trac.webkit.org/wiki/BuildingQtOnWindows
Attachments
Windows XP linking errors (22.02 KB, text/plain)
2011-03-20 05:21 PDT, Nancy Piedra
no flags
Change to qwebkitglobal.h (438 bytes, patch)
2011-03-20 18:03 PDT, Nancy Piedra
no flags
Change to webcore.pro to export qtwebkit symbols (387 bytes, patch)
2011-03-24 05:57 PDT, Nancy Piedra
no flags
Fixes linking errors in Qt Webkit Windows MinGW build. (1.06 KB, patch)
2011-03-25 08:06 PDT, Nancy Piedra
no flags
Link error while --3d-canvas option is enabled (10.46 KB, text/plain)
2011-03-27 09:29 PDT, Joseph Tsai
no flags
Nancy Piedra
Comment 1 2011-03-20 05:25:04 PDT
To determine whether the problem is due to the setting of the QWEBKIT_EXPORT macro, I added the following two lines to qwebkitglobal.h. #define QT_MAKEDLL #define BUILDING_WEBKIT By doing the above, I was able to get it to link. But I could not figure out how to set these through the .pro/pri files properly. Still working on that.
Nancy Piedra
Comment 2 2011-03-20 06:23:58 PDT
The log shows I used c:\Qt\2010.05 but the same problem exists with C:\Qt\4.7.2.
Nancy Piedra
Comment 3 2011-03-20 18:03:15 PDT
Created attachment 86286 [details] Change to qwebkitglobal.h This change seems to fix the problem. Need to check other builds to make sure it doesn't cause any regression.
Nancy Piedra
Comment 4 2011-03-21 09:43:16 PDT
After speaking with Laszlo Gombos, this seems like qt layering violations we may be able to fix. I will start looking at that and seeing if I can instead submit patches for the layering violations.
Laszlo Gombos
Comment 5 2011-03-23 19:22:26 PDT
*** Bug 55050 has been marked as a duplicate of this bug. ***
Nancy Piedra
Comment 6 2011-03-24 05:57:07 PDT
Created attachment 86760 [details] Change to webcore.pro to export qtwebkit symbols This patch sets the BUILDING_WEBKIT & QT_MAKEDLL macros which in turn will define the QTWEBKIT_EXPORT macro as follows: #define QWEBKIT_EXPORT Q_DECL_EXPORT This patch also solves the problem.
Andras Becsi
Comment 7 2011-03-25 05:55:40 PDT
(In reply to comment #6) > Created an attachment (id=86760) [details] > Change to webcore.pro to export qtwebkit symbols > > This patch sets the BUILDING_WEBKIT & QT_MAKEDLL macros which in turn will define the QTWEBKIT_EXPORT macro as follows: > #define QWEBKIT_EXPORT Q_DECL_EXPORT > > This patch also solves the problem. LGTM. Ossy could you check whether this also works on your setup? Nancy, please upload a patch with a ChangeLog for the change and set the r? flag if you'd like the patch to get into trunk and to let the EWS' process it. For more information see: http://trac.webkit.org/wiki/QtWebKitContrib
Csaba Osztrogonác
Comment 8 2011-03-25 06:38:35 PDT
I tried it, and it works on my Windows machine with MinGW. Laszlo, have you got any objection against Nancy's fix? (apart from missing ChangeLog)
Nancy Piedra
Comment 9 2011-03-25 08:06:26 PDT
Created attachment 86943 [details] Fixes linking errors in Qt Webkit Windows MinGW build. Add patch for review.
Joseph Tsai
Comment 10 2011-03-27 09:29:02 PDT
Created attachment 87075 [details] Link error while --3d-canvas option is enabled (In reply to comment #9) > Created an attachment (id=86943) [details] > Fixes linking errors in Qt Webkit Windows MinGW build. For building QtWebKit with applying Nancy's patch and WebGL supported (by enabling --3d-canvas option), other undefined references occur again. These undefined references are all about OpenGL functions. (i.e. glDeleteTextures@8) After digging in the building process, I found that these undefined references should be declared in -lopengl32 option (mingw/lib/libopengl32.a). When building QtWebKit4.dll, the linking option -lopengl32 is before -lwebcore, and the undefined references in libwebcore.a miss their linkage. For quick workaround, I appended -lopengl32 behind the LIBS variable in Source/WebCore/WebCore.pri: -------------------------------------- --- WebCore.pri.orig 2011-03-26 18:01:54.000000000 +0800 +++ WebCore.pri 2011-03-27 23:51:14.000000000 +0800 @@ -368,7 +368,7 @@ POST_TARGETDEPS += $${pathToWebCoreOutput}$${QMAKE_DIR_SEP}$${WEBCORE_TARGET}.lib } else { QMAKE_LIBDIR = $$pathToWebCoreOutput $$QMAKE_LIBDIR - LIBS = -l$$WEBCORE_TARGET $$LIBS + LIBS = -l$$WEBCORE_TARGET $$LIBS -lopengl32 POST_TARGETDEPS += $${pathToWebCoreOutput}$${QMAKE_DIR_SEP}lib$${WEBCORE_TARGET}.a } -------------------------------------- And the building is passed.
Joseph Tsai
Comment 11 2011-03-27 10:00:14 PDT
> For building QtWebKit with applying Nancy's patch and WebGL supported (by enabling --3d-canvas option), other undefined references occur again. These undefined references are all about OpenGL functions. (i.e. glDeleteTextures@8) The building command that I used: perl Tools\Scripts\build-webkit --qt --3d-canvas --release
Csaba Osztrogonác
Comment 12 2011-03-28 04:43:56 PDT
Comment on attachment 86943 [details] Fixes linking errors in Qt Webkit Windows MinGW build. r=me
Csaba Osztrogonác
Comment 13 2011-03-28 04:55:02 PDT
Comment on attachment 86943 [details] Fixes linking errors in Qt Webkit Windows MinGW build. Landed in http://trac.webkit.org/changeset/82102. Please don't forget to add bug number to the ChangeLog next time.
Nancy Piedra
Comment 14 2011-03-28 05:30:18 PDT
(In reply to comment #11) > > For building QtWebKit with applying Nancy's patch and WebGL supported (by enabling --3d-canvas option), other undefined references occur again. These undefined references are all about OpenGL functions. (i.e. glDeleteTextures@8) > The building command that I used: > perl Tools\Scripts\build-webkit --qt --3d-canvas --release Joseph - I can create a separate bug for this and see about fixing it. If you already created the bug, let me know the number.
Joseph Tsai
Comment 15 2011-03-28 05:41:46 PDT
(In reply to comment #14) > (In reply to comment #11) > > The building command that I used: > > perl Tools\Scripts\build-webkit --qt --3d-canvas --release > > Joseph - I can create a separate bug for this and see about fixing it. If you already created the bug, let me know the number. I have not created any bug report about this issue yet.
Andras Becsi
Comment 16 2011-03-28 05:44:04 PDT
(In reply to comment #14) > (In reply to comment #11) > > > For building QtWebKit with applying Nancy's patch and WebGL supported (by enabling --3d-canvas option), other undefined references occur again. These undefined references are all about OpenGL functions. (i.e. glDeleteTextures@8) > > The building command that I used: > > perl Tools\Scripts\build-webkit --qt --3d-canvas --release > > Joseph - I can create a separate bug for this and see about fixing it. If you already created the bug, let me know the number. I already created one and am preparing a patch for the issue: https://bugs.webkit.org/show_bug.cgi?id=57225
Note You need to log in before you can comment on or make changes to this bug.