Disabling webkit



  • Hi. I made my first QT project (in QT5) and I have the exe up and running but the size of the needed DLLs is quite big. The 3 ICU DLLs are almost 50% of that, and since I don't use web pages or js I think my exe should work without them.

    I found lots of threads about deselecting these 3 DLLs, they usually say that you should run this command at the CMD prompt:

    configure.exe -no-webkit (or possibly configure.exe --no-webkit)

    I located configure.exe in C:\Qt\Qt5.2.1\5.2.1\Src\qtbase. But I get the error message "Unable to detect the platform from environment. Use -platform command lineargument or set the QMAKESPEC environment variable and run configure again. See the README file for a list of supported operating systems and compilers." whether I run it with or without arguments

    Things I've read about this in other forums threads of various age are:

    • The flag -no-webkit isn't supported anymore (but still in help file)
    • The flag does work
    • An alternative is to delete the folder qtwebkit or webkit

    I'm hoping that one of these alternatives might work, but I wonder which one and how:

    1. Is there any setting for this in QT Create, or can I add a flag in there?
    2. Should I do something about env variable QMAKESPEC (what exactly)?
    3. There are 11 qtwebkit folders in my install, and 10 webkit folders. Which to delete/rename?

    I'm using the 32b mingw version of QT 5.2.1 on a 64b Windows 7 PC.

    Thanks.



  • This is the new way, -skip qtwebkit -skip qtwebkit-examples



  • Thanks. Wow that was a fast reply!

    Remember I'm a newbie at QT but I'm guessing you mean I should run "configure.exe -skip qtwebkit -skip qtwebkit-examples". I tried that but got the same error as before. I could try to fix what's mentioned in that error msg I suppose, but env variable QMAKESPEC is not defined on my PC and neither is INCLUDEPATH which I read about "here":http://qt-project.org/doc/qt-4.8/qmake-environment-reference.html#qmakespec. I have 4 mkspecs folders. And I have no idea what "-platform command lineargument" means. Wish I had a help file for the configure command.



  • It tells configure what platform you are targeting. Since you use mingw, I think "configure.exe -skip qtwebkit -skip qtwebkit-examples -platform win32-g++" should work for you. Granted you have to have mingw setup properly and the correct environment variable for the command prompt to know where mingw is.



  • Well it seems to "configure" now after some tweaking, but doesn't do the job.

    After I ran "configure.exe -skip qtwebkit -skip qtwebkit-examples -platform win32-g++", after having selected open-source version and accepted license, it said:

    @Creating qmake...
    execute: File or path is not found (mingw32-make)
    execute: File or path is not found (mingw32-make)
    Cleaning qmake failed, return code -1@

    I added paths for qmake.exe, mingw32-make.exe and configure.exe to an existant Windows system variable called PATH:

    C:\Qt\Qt5.2.1\5.2.1\mingw48_32\bin;C:\Qt\Qt5.2.1\Tools\mingw48_32\bin;C:\Qt\Qt5.2.1\5.2.1\Src\qtbase

    After that I ran "configure.exe -skip qtwebkit -skip qtwebkit-examples -platform win32-g++" and after a minute of working (filling the screen with log data several times), it stopped at

    @Running configuration tests...
    WARNING: The DirectX SDK could not be detected:
    There is no Direct X SDK installed or the environment variable "DXSDK_DIR" is
    not set.
    Disabling the ANGLE backend.

    WARNING: Using OpenGL ES 2.0 without ANGLE.
    Specify -opengl desktop to use Open GL.
    The build will most likely fail.
    (Press any key to continue...)
    @

    I pressed a key and after some additonal lengthy logging it ended with

    @Generating Makefiles...
    Info: creating cache file C:/Users/HTPC/.qmake.cache

    Qt is now configured for building. Just run mingw32-make.
    To reconfigure, run mingw32-make confclean and configure.@

    I tried starting my app in QT explorer, but Prcess Explorer says it still uses the 3 ICU DLLs

    Not knowing exactly what I was doing but trying to follow advice in error message above, I ran

    configure.exe -skip qtwebkit -skip qtwebkit-examples -platform win32-g++ -opengl desktop

    It ended after just a few secs, with no errors or warnings.

    But still, when I start my app in QT Creator, I can see in Process Explorer that it insists on using the 3 ICU DLLs.

    (I suppose I could try to make it use DirectX by adding the mentioned system variable but I can't see how that could fix my actual problem.)

    So no more error messages, but it doesn't do what I wanted it to do.


  • Moderators

    Hi,

    [quote]After I ran “configure.exe -skip qtwebkit -skip qtwebkit-examples -platform win32-g++”...[/quote]I believe you are meant to call configure.bat (not .exe) from the level above 'qtbase'.

    [quote]I pressed a key and after some additonal lengthy logging it ended with
    @
    Generating Makefiles...
    Info: creating cache file C:/Users/HTPC/.qmake.cache

    Qt is now configured for building. Just run mingw32-make.
    To reconfigure, run mingw32-make confclean and configure.
    @

    I tried starting my app in QT explorer, but Prcess Explorer says it still uses the 3 ICU DLLs[/quote]Configuring does not change your existing DLLs. It only prepares your source code for compilation. After configuring, you still need to run mingw32-make to generate your custom DLLs that don't use ICU.

    Anyway, you should download the "official source code package":http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.zip.mirrorlist and extract it into a folder that's completely separate from your current installation.

    if you compile from C:\Qt\Qt5.2.1\5.2.1\Src\qtbase, your new DLLs will be integrated into your existing installation. You don't want that; the chance of breaking something is extremely high.

    Make sure you remove the existing Qt from PATH first.

    [quote]
    @
    Running configuration tests...
    WARNING: The DirectX SDK could not be detected:
    There is no Direct X SDK installed or the environment variable "DXSDK_DIR" is
    not set.
    Disabling the ANGLE backend.
    @
    [/quote]Do you want to use ANGLE (DirectX) or OpenGL? If the former, you need to install the DirectX SDK. If the latter, you need to pass "-opengl desktop" to configure.bat.



  • Thanks for trying to help, but I didn't expect it to be this complicated.. Almost seems like I'm not supposed to be able to do this.

    I have read several threads on the configure command and all use configure.exe. And I've seen an (old) post when obviusly all he had to do was write configure.exe -no-webkit. How come this has changed so much and become so overly complicated?

    Since I use QT Creator, I would think mingw32-make as well as qmake are run by it. And I didn't realize I am changing the QT DLLs, I thought I was just telling it to exclude some of them?

    I don't think it matters if I use OpenGL or DirectX since it is graphically very simple so I could choose OpenGL if i's easier, but since the PC has DirectX as well as a complete install of VSS C++ Ultimate 2012 one would think the SDK is there.

    What about just deleting a couple of folders, if I just knew which ones? Or to go for a statically linked exe?



  • If you have VS2012 installed, why even configure and build qt? Those come in a prebuilt package already both in 32bit and 64bit.

    If you statically link, you might have problems with the LGPL license.



  • Because QT Quick has a handy way of making GUI that is both quite capable and easy to use. Tried MFC with VSS for a bit, didn't like it. And without MFC you can sit forever with just minor tweaks and it ends up looking very boring.

    I think the license probably works fine based on what I've read altough since it is not 100% clear some people tend to assume the worst. But the best solution would be to get rid of webkit. I will either keep the program to myself or release it as shareware in which case Digia is welcome to sue me for part of the profit.. I don't think they'd bother to try but since I do own a company I'd rather avoid even small risks.

    But those things are not what I wanted to discuss here. Still hoping for an easy way to kick the webkit DLLs out.


  • Moderators

    An alternative is to use a dummy ICU DLL: http://qt-project.org/forums/viewthread/38489/

    BTW, ICU != WebKit

    [quote author="DavidGGG" date="1392998887"]I have read several threads on the configure command and all use configure.exe.[/quote]Can you share links to these threads?

    [quote]And I've seen an (old) post when obviusly all he had to do was write configure.exe -no-webkit. How come this has changed so much and become so overly complicated?[/quote]I'm not sure, but I think it's related to the major restructuring of Qt. Qt 4 compiled EVERYTHING, and you were given the choice to omit WebKit only. Qt 5 is highly modular; you can skip multiple modules.

    [quote]Since I use QT Creator, I would think mingw32-make as well as qmake are run by it.[/quote]They are run by Qt Creator.

    I'm not sure what you're saying here...?

    [quote]And I didn't realize I am changing the QT DLLs, I thought I was just telling it to exclude some of them?[/quote]No. Qt uses ICU for internationalization (translations, time zones, locale configuration, etc.), not just for WebKit. ICU support is determined when you compile Qt. If enabled, Qt Core classes will call ICU functions. You can't exclude ICU after the DLLs have been compiled.

    Anyway, this is a compilation configuration. In many Linux projects, the basic pattern for building a project is:

    configure

    make

    make install

    [quote]I don't think it matters if I use OpenGL or DirectX since it is graphically very simple so I could choose OpenGL if i's easier, but since the PC has DirectX as well as a complete install of VSS C++ Ultimate 2012 one would think the SDK is there.[/quote]It sounds like you haven't told your MinGW tool chain where to find the DirectX SDK yet. Your MSVC 2012 tool chain will automatically find the DirectX SDK.

    [quote]What about just deleting a couple of folders, if I just knew which ones? Or to go for a statically linked exe?[/quote]If you don't have ICU installed, your custom build of Qt will automatically disable ICU support.



  • Thank for the tip on dummy DLL, it solves my problem!

    You wanted links to pages with configure.exe. In case you're still interested, here are a few pages I stumbled upon when looking for how to exclude webkit, and specifically using -no-webkit (but they didn't lead to a solution):
    http://qt-project.org/forums/viewthread/38662
    http://www.qtcentre.org/threads/51364-configure-exe-no-webkit-problem
    https://qt-project.org/forums/viewthread/20725
    http://qt-project.org/doc/qt-4.8/configure-options.html
    http://stackoverflow.com/questions/5587141/recommended-flags-for-a-minimalistic-qt-build


  • Moderators

    I'm glad that you've found a solution. :)

    Note that all the links you posted were for Qt 4. Things are different in Qt 5, for reasons I described in my previous post.

    The official Qt 5 documentation says to use configure.bat: http://qt-project.org/doc/qt-5/configure-options.html (Your links include the Qt 4 version of this page)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.