Important: Please read the Qt Code of Conduct -

Problem compiling wkhtmltopdf-qt

  • Hi, I have a problem compiling the wkhtmltopdf-qt library, there it is what I have done:

    aptitude install openssl build-essential xorg libssl-dev libxrender-dev libxext-dev git-core libqt4-dev qt4-dev-tools

    git clone git:// wkhtmltopdf-qt
    cd wkhtmltopdf-qt
    git checkout 4.8.4
    QTDIR=. ./bin/syncqt
    cd wkhtmltopdf-qt
    ./configure -nomake tools,examples,demos,docs,translations -opensource -prefix "../wkqt"
    make -j3

    I have basically followed this guide: installing some other libraries I needed

    When I do the "make" this is the output:

    make[2]: *** [../../../../../../lib/] Error 1
    make[2]: Leaving directory /root/wkhtmltopdf-qt/src/3rdparty/webkit/Source/WebKit/qt' make[1]: *** [sub-WebKit-qt-QtWebKit-pro-make_default-ordered] Error 2 make[1]: Leaving directory/root/wkhtmltopdf-qt/src/3rdparty/webkit/Source'
    make: *** [sub-webkit-make_default-ordered] Error 2

    Note that I am using Debian in case that matters.
    This is getting a little bit on my nerves, if someone could help me I would really appreciate it, thank you very much

  • Moderators


    Read the last comment (2 Feb 2014) at -- the user seemed to use slightly different steps from yours.

    Anyway, have you tried downloading Qt from the Debian repo? You won't have to build it yourself then.

  • Hi, sorry for aswering that late.
    Yes I read the last comment, he basically add some libraries.
    You mean download and installing wkhtmltopdf the .deb, or the wkhtmltopdf-qt .deb¿?
    The problem is that I need the features of the patched QT library, and I have to compile it for that, so the .deb wouldn't work I think.
    If someone have tried and know exactly what .deb to download and works tell me please, otherwise I would appreciate if someone put me on the right way to compile it ! Thank you very much

  • Hello everyone, it seems that I have finally got this working, but I don't want to mark the post as [SOLVED] cause I would like to ask for your help with understanding the process I did, which I think is completly stupid and it shows the low knowledge I have with this library. This is what I did :

    1. apt-get intall wkhtmltopdf xvfb git-core build-essential libqt4-dev qt4-dev-tools

    2. git clone git:// wkhtmltopdf

    3. cd wkhtmltopdf

    4. qmake-qt4

    5. make && make install

    6. cd..

    7. git clone git:// wkhtmltopdf-qt

    8. cd wkhtmltopdf-qt

    9. git checkout 4.8.4

    10. QTDIR=. ./bin/syncqt

    11. ./configure -nomake tools,examples,demos,docs,translations -opensource -prefix "../wkqt"

    12. make && make install

    13. apt-get remove wkhtmltopdf

    14. cd ..

    15. cd wkhtmltopdf

    16. ../wkqt/bin/qmake

    17. make && make install

    Well I do that, and I get this working, but, as maybe someone have seen, it seems completly stupid what I do, because I am installing 3 times wkhtmltopdf, the problem is, I have seen the dependancies of wkhtmltopdf (apt-rdepends wkhtmtopdf), I have installed the libraries related to where I have the problems (libwebqkit4 among others), and I can't compile the wkhtmltopdf library, I have the error I mentioned in the first post (error related to the libwebkit).

    Even worse is, that I skip steps 4 and 5:

    1. qmake-qt4

    2. make && make install

    and I do the process exactly, I can only compile the wkhtmtopdf-qt but not the wkhtmltopdf, where I get this error:

    ../lib/multipageloader.hh:32:20: fatal error: QWebPage: No such file or directory
    compilation terminated.
    make[1]: *** [../../build/multipageloader.o] Error 1
    make[1]: Leaving directory `/root/wkhtmltopdf/src/lib'
    make: *** [sub-src-lib-make_default-ordered] Error 2

    I need to document the process for compiling and installing it, but I can't to this that way, installing 1 program 3 times, for getting that working, I don't know why if I do like that it works and not if I do the "normal" way.
    Sorry for this so long post, but I didn't know how to explain it in a shorter way =(, I just tried to expose the problem as best as I could, thank you very much in advance

  • Moderators


    Since wkhtmltopdf has patched Qt, then it's best if you ask the project maintainers themselves to see if the patch changed any part of the build process.

    Normally it's quite straightforward to build Qt on a modern computer.

  • Hey, yes it should be easy but... for me it wasn't, I spent so much time with it.
    Sorry for my noob question but, any suggestion about how to get in contact with the maintainers ¿? Never done that before sorry, Thank you !!!

  • Moderators

    [quote author="adon90" date="1395789699"]Sorry for my noob question but, any suggestion about how to get in contact with the maintainers ¿? Never done that before sorry, Thank you !!![/quote]I don't know, sorry. Try searching their website:

    Note: wkhtmltopdf is a 3rd-party tool that is not affiliated with the Qt Project. We don't know how their patches affect the Qt build process -- that's why it's difficult for us to help you with building wkhtmltopdf-qt. (We can, however, help you if you want to build the official version of Qt)

    By the way, the first link you gave ( ) says that page is deprecated. Are you sure you are looking at the latest version of wkhtmltopdf? See instead.

Log in to reply