Qt Labs Forum » WebKit

Compile under Windows

(4 posts)

  1. The blog post on QtWebkit on windows fails to explain how to achieve those results, and points to the wiki which also contains incomplete or incorrect instructions.

    I got it to partially compile only, using the provided instructions. Now I hit a pthread wall (failed includes). The pthread is not in the wiki list of required packages. I have no idea if it was supposed to use pthreads at all, or if it is compiling the wrong cpp file. It is quite silly to use pthread since Qt has native threads.

    Any words of advice? Thanks.

    Posted: 1 year #
  2. peterdh
    peterdh
    Member

    Last week I had some spare time and got the webkit and the extra tools (bizon, ...) like it was explained on the wiki.
    The compiler I used was VC++ 8.0 (VS2005), and the web kit compiled almost out of the box. I only had to modify about 5 lines of code, and it works like a charm.

    Posted: 1 year #
  3. peterdh
    peterdh
    Member

    I redid the exercise to build webkit from scratch under windows on a fresh installed windows XP.
    I installed visual studio 2005, QT 4.3.1 (commercial edition) and the tools from the gnuwin32 project as mentioned on the wiki.
    Next step was execute

    perl WebKitToolsScriptsbuild-webkit

    from the webkit directory.
    First problem I encountered was:

    ../../../WebCore/loader/FTPDirectoryDocument.cpp(233) : error C3861: 'localtime_r': identifier not found.

    I modified the line into the following lines:

    #if PLATFORM(WIN_OS)
        localtime_s(&now, &now_t);
    #else
        localtime_r(&now_t, &now);
    #endif

    Next compilation error was:

    ../../../WebCore/loader/FTPDirectoryParser.cpp(138) : error C3861: 'gmtime_r': identifier not found

    Same error occurs on lines 1108 and 1548.
    Modify these lines into:

    #if PLATFORM(WIN_OS)
                    gmtime_s(&result.modifiedTime, &t);
    #else
                    gmtime_r(&t, &result.modifiedTime);
    #endif

    The last error I encounter was:

    ../../../JavaScriptCore/wtf/MathExtras.h(117) : error C3861: 'rand_s': identifier not found

    While rand_s is defined in stdlib.h I still had problems compiling it, so I commented out from line 106 till 122 and modified line 123 into

    #endif

    (ofcourse remove line 137). In this way you are not using the rand_s function but srand and rand functions.
    After this it is waiting until the compilation ends and then you can start the QtLauncher without any problem.

    Greetings
    Peter

    Posted: 1 year #
  4. There's a better way to fix the error you were getting with the missing rand_s definition, namely, by #defining the _CRT_RAND_S macro before compiling, as documented in this MSDN article.

    Posted: 1 year #

RSS feed for this topic

Reply

You must log in to post.



© 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners.