(Re)building Qt plugin libraries from source



  • Hi all,

    I have just recently worked with the tuiotouch plugin (included in Qt since 5.5). I would like to apply some adjustments to it and would therefore have to rebuild the plugin .dll. I was hoping that I would be able to simply use the project file @ C:\Qt<version>\Src\qtbase\src\plugins\generic\tuiotouch\tuiotouch.pro and build it to create a new dynamic library. Unfortunately, building only produces a shadow built folder with the following structure:

    .moc/
    .obj/
    .pch/
    Makefile
    Makefile.Debug
    Makefile.Release
    qtuiotouchplugin_resource.rc
    qtuiotouchplugind_resource.rc
    

    None of the folders above contain the .dll and I am left wondering how to achieve what I am looking for. Right now I am building the entire source code using C:\Qt<version>\Src\qt.pro. I am expecting this will produce the .dll, because the source tree it is generating looks much like the default binary distributed version.

    Is there an easy way to build only the plugin, as mentioned above?


  • Moderators

    @Vagabond said in (Re)building Qt plugin libraries from source:

    Is there an easy way to build only the plugin, as mentioned above?

    I don't think so. It is possible for SQL plugins, but apparently not for this one. You need to (at least) configure Qt and compile qtbase - then you'll be able to compile the plugin only.

    A guide for building Qt can be found here: https://wiki.qt.io/Building_Qt_5_from_Git Since you already have the source code, you can probably skip the part about getting it from git.



  • @sierdzio Great answer! Thanks a bunch. I am on it right now.



  • @sierdzio Getting closer. Currently the build fails stating:

    In member function 'virtual QSize QWindowsVistaStyle::sizeFromContents(QStyle::ContentsType, const QStyleOption*, const QSize&, const QWidget*) const':
    styles\qwindowsvistastyle.cpp:1872:9: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
             if (!sz.isEmpty())
             ^~
    styles\qwindowsvistastyle.cpp:1874:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
                 return sz;
                 ^~~~~~
    cc1plus.exe: all warnings being treated as errors
    

    I am having a hard time maneuvering around the extensive build structure...
    Can I configure the build pipeline not to treat warnings as errors? If yes, where would I do that?

    I found that -Wall -Werror -Wno-error=misleading-indentation might do the trick. I just don't know where to set it.

    EDIT: found that the configure cmd tool offers a -warnings-are-errors option, which defaults to yes when using -developer-build else it defaults to no. The problem is I cannot call configure -developer-build -opensource -nomake examples -nomake tests -opengl desktop -warnings-are-errors no. Configure will stop stating ERROR: Invalid command line parameter 'no'. I am now configuring without -developer-build just to see if that works. Any input would still be appreciated.


  • Moderators

    You should only use -developer-build is you plant to contribute to Qt. If you're building for yourself, there is no need to add that flag.


Log in to reply
 

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