wkhtmltopdf

Error

wkhtmltopdf-qt# make -j3
...
g++ -c -include .pch/release-shared/QtGui -m64 -pipe -g -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/harfbuzz -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -I/usr/include/freetype2 -fPIC -DQT_SHARED -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_NO_OPENTYPE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_S60 -DQ_INTERNAL_QAPP_SRC -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++-64 -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I.rcc/release-shared -I../3rdparty/xorg -I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/release-shared -I/usr/X11R6/include -I.uic/release-shared -o .obj/release-shared/qpdf.o painting/qpdf.cpp
In file included from ../../include/QtGui/private/qcups_p.h:1:0,
                 from painting/qpdf.cpp:47:
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:78:11: error: ‘ppd_file_t’ does not name a type
     const ppd_file_t* setCurrentPrinter(int index);
           ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:80:11: error: ‘ppd_file_t’ does not name a type
     const ppd_file_t* currentPPD() const;
           ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:81:11: error: ‘ppd_option_t’ does not name a type
     const ppd_option_t* ppdOption(const char *key) const;
           ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:84:11: error: ‘ppd_option_t’ does not name a type
     const ppd_option_t* pageSizes() const;
           ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:87:34: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
     void saveOptions(QList<const ppd_option_t*> options, QList<const char*> markedOptions);
                                  ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:87:47: error: template argument 1 is invalid
     void saveOptions(QList<const ppd_option_t*> options, QList<const char*> markedOptions);
                                               ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:103:56: error: ‘ppd_group_t’ does not name a type
     void collectMarkedOptions(QStringList& list, const ppd_group_t* group = 0) const;
                                                        ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:103:77: error: ISO C++ forbids declaration of ‘group’ with no type [-fpermissive]
     void collectMarkedOptions(QStringList& list, const ppd_group_t* group = 0) const;
                                                                             ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:104:62: error: ‘ppd_group_t’ does not name a type
     void collectMarkedOptionsHelper(QStringList& list, const ppd_group_t* group) const;
                                                              ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:104:75: error: ISO C++ forbids declaration of ‘group’ with no type [-fpermissive]
     void collectMarkedOptionsHelper(QStringList& list, const ppd_group_t* group) const;
                                                                           ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:108:11: error: ‘ppd_option_t’ does not name a type
     const ppd_option_t* page_sizes;
           ^
../../include/QtGui/private/../../../src/gui/painting/qcups_p.h:110:5: error: ‘ppd_file_t’ does not name a type
     ppd_file_t *currPPD;
     ^
painting/qpdf.cpp: In member function ‘virtual void QPdfBaseEngine::setProperty(QPrintEngine::PrintEnginePropertyKey, const QVariant&)’:
painting/qpdf.cpp:1470:5: warning: case value ‘65024’ not in enumerated type ‘QPrintEngine::PrintEnginePropertyKey’ [-Wswitch]
     case PPK_CupsOptions:
     ^
painting/qpdf.cpp:1464:5: warning: case value ‘65025’ not in enumerated type ‘QPrintEngine::PrintEnginePropertyKey’ [-Wswitch]
     case PPK_CupsPageRect:
     ^
painting/qpdf.cpp:1467:5: warning: case value ‘65026’ not in enumerated type ‘QPrintEngine::PrintEnginePropertyKey’ [-Wswitch]
     case PPK_CupsPaperRect:
     ^
painting/qpdf.cpp:1473:5: warning: case value ‘65027’ not in enumerated type ‘QPrintEngine::PrintEnginePropertyKey’ [-Wswitch]
     case PPK_CupsStringPageSize:
     ^
painting/qpdf.cpp: In member function ‘virtual QVariant QPdfBaseEngine::property(QPrintEngine::PrintEnginePropertyKey) const’:
painting/qpdf.cpp:1584:5: warning: case value ‘65024’ not in enumerated type ‘QPrintEngine::PrintEnginePropertyKey’ [-Wswitch]
     case PPK_CupsOptions:
     ^
painting/qpdf.cpp:1578:5: warning: case value ‘65025’ not in enumerated type ‘QPrintEngine::PrintEnginePropertyKey’ [-Wswitch]
     case PPK_CupsPageRect:
     ^
painting/qpdf.cpp:1581:5: warning: case value ‘65026’ not in enumerated type ‘QPrintEngine::PrintEnginePropertyKey’ [-Wswitch]
     case PPK_CupsPaperRect:
     ^
painting/qpdf.cpp:1587:5: warning: case value ‘65027’ not in enumerated type ‘QPrintEngine::PrintEnginePropertyKey’ [-Wswitch]
     case PPK_CupsStringPageSize:
     ^
make[1]: *** [.obj/release-shared/qpdf.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/wildan/jobstuff/software/wkhtml/0.12/wkhtmltopdf-qt/src/gui'
make: *** [sub-gui-make_default-ordered] Error 2

Untuk memperbaiki error ini bisa melihat patch [5] atau pada file wkhtmltopdf-qt/src/gui/painting/qcups_p.h ditambah baris :

#include <cups/ppd.h>

setelah 

#include <cups/cups.h>.

Selain itu, sebelum melakukan kompilasi, selain menginstall beberapa paket yg diperintahan pada [1]/[2]/[3]/[4], diinstall juga beberapa paket berikut :

qt4-bin-dbg, qt4-default, qt4-demos, qt4-designer, qt4-dev-tools, qt4-doc, qt4-linguist-tools, qt4-qmake, libcups2-dev. libcupsppdc1-dev, libppd-dev

Ketika melakukan kompilasi wkhtmltopdf

cd wkhtmltopdf
../wkqt/bin/qmake
make -j3

Terjadi error sebagai berikut : 

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=12 -DPATCH_VERSION=0 -DBUILD= -DQT_SHARED -DBUILDING_DLL -D__WKHTMLTOX_UNDEF_QT_DLL__ -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_SVG_LIB -DQT_XMLPATTERNS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4/QtSvg -I/usr/include/qt4/QtWebKit -I/usr/include/qt4 -I../../include -I../../build -o ../../build/moc_utilities.o ../../build/moc_utilities.cpp
In file included from ../../build/moc_pdfconverter_p.cpp:10:0:
../../build/../src/lib/pdfconverter_p.hh: In constructor ‘wkhtmltopdf::PageObject::PageObject(const wkhtmltopdf::settings::PdfObject&, const QString*)’:
../../build/../src/lib/pdfconverter_p.hh:97:50: error: class ‘wkhtmltopdf::PageObject’ does not have any field named ‘headerReserveHeight’
         settings(set), loaderObject(0), page(0), headerReserveHeight(0), footerReserveHeight(0),
                                                  ^
../../build/../src/lib/pdfconverter_p.hh:97:74: error: class ‘wkhtmltopdf::PageObject’ does not have any field named ‘footerReserveHeight’
         settings(set), loaderObject(0), page(0), headerReserveHeight(0), footerReserveHeight(0),
                                                                          ^
../../build/../src/lib/pdfconverter_p.hh:98:9: error: class ‘wkhtmltopdf::PageObject’ does not have any field named ‘measuringHeader’
         measuringHeader(0), measuringFooter(0) {
         ^
../../build/../src/lib/pdfconverter_p.hh:98:29: error: class ‘wkhtmltopdf::PageObject’ does not have any field named ‘measuringFooter’
         measuringHeader(0), measuringFooter(0) {
                             ^
../../build/../src/lib/pdfconverter_p.hh: At global scope:
../../build/../src/lib/pdfconverter_p.hh:137:2: error: ‘QWebPrinter’ does not name a type
  QWebPrinter * webPrinter;
  ^
In file included from ../lib/pdfconverter.cc:27:0:
../lib/pdfconverter_p.hh: In constructor ‘wkhtmltopdf::PageObject::PageObject(const wkhtmltopdf::settings::PdfObject&, const QString*)’:
../lib/pdfconverter_p.hh:97:50: error: class ‘wkhtmltopdf::PageObject’ does not have any field named ‘headerReserveHeight’
         settings(set), loaderObject(0), page(0), headerReserveHeight(0), footerReserveHeight(0),
                                                  ^
../lib/pdfconverter_p.hh:97:74: error: class ‘wkhtmltopdf::PageObject’ does not have any field named ‘footerReserveHeight’
         settings(set), loaderObject(0), page(0), headerReserveHeight(0), footerReserveHeight(0),
                                                                          ^
../lib/pdfconverter_p.hh:98:9: error: class ‘wkhtmltopdf::PageObject’ does not have any field named ‘measuringHeader’
         measuringHeader(0), measuringFooter(0) {
         ^
../lib/pdfconverter_p.hh:98:29: error: class ‘wkhtmltopdf::PageObject’ does not have any field named ‘measuringFooter’
         measuringHeader(0), measuringFooter(0) {
                             ^
../lib/pdfconverter_p.hh: At global scope:
../lib/pdfconverter_p.hh:137:2: error: ‘QWebPrinter’ does not name a type
  QWebPrinter * webPrinter;
  ^
../lib/pdfconverter.cc: In member function ‘virtual void wkhtmltopdf::PdfConverterPrivate::beginConvert()’:
../lib/pdfconverter.cc:169:19: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘measuringHeader’
                 o.measuringHeader = &measuringHFLoader.addResource(
                   ^
../lib/pdfconverter.cc:169:38: error: ‘measuringHFLoader’ was not declared in this scope
                 o.measuringHeader = &measuringHFLoader.addResource(
                                      ^
../lib/pdfconverter.cc:174:19: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘headerReserveHeight’
                 o.headerReserveHeight = settings.margin.top.first + s.header.spacing;
                   ^
../lib/pdfconverter.cc:188:19: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘measuringFooter’
                 o.measuringFooter = &measuringHFLoader.addResource(
                   ^
../lib/pdfconverter.cc:188:38: error: ‘measuringHFLoader’ was not declared in this scope
                 o.measuringFooter = &measuringHFLoader.addResource(
                                      ^
../lib/pdfconverter.cc:193:19: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘footerReserveHeight’
                 o.footerReserveHeight = settings.margin.bottom.first + s.footer.spacing;
                   ^
../lib/pdfconverter.cc:210:9: error: ‘measuringHFLoader’ was not declared in this scope
         measuringHFLoader.load();
         ^
../lib/pdfconverter.cc:221:20: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘headerReserveHeight’
         objects[0].headerReserveHeight = settings.margin.top.first;
                    ^
../lib/pdfconverter.cc:222:20: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘footerReserveHeight’
         objects[0].footerReserveHeight = settings.margin.bottom.first;
                    ^
../lib/pdfconverter.cc: In member function ‘qreal wkhtmltopdf::PdfConverterPrivate::calculateHeaderHeight(wkhtmltopdf::PageObject&, QWebPage&)’:
../lib/pdfconverter.cc:236:5: error: ‘QWebPrinter’ was not declared in this scope
     QWebPrinter wp(header.mainFrame(), testPrinter, *testPainter);
     ^
../lib/pdfconverter.cc:236:17: error: expected ‘;’ before ‘wp’
     QWebPrinter wp(header.mainFrame(), testPrinter, *testPainter);
                 ^
../lib/pdfconverter.cc:237:20: error: ‘wp’ was not declared in this scope
     qreal height = wp.elementLocation(header.mainFrame()->findFirstElement("body")).second.height();
                    ^
../lib/pdfconverter.cc:232:27: warning: unused variable ‘s’ [-Wunused-variable]
     settings::PdfObject & s = object.settings;
                           ^
../lib/pdfconverter.cc: In member function ‘void wkhtmltopdf::PdfConverterPrivate::preprocessPage(wkhtmltopdf::PageObject&)’:
../lib/pdfconverter.cc:273:3: error: ‘outline’ was not declared in this scope
   outline->addEmptyWebPage();
   ^
../lib/pdfconverter.cc:291:2: error: ‘QWebPrinter’ was not declared in this scope
  QWebPrinter wp(obj.page->mainFrame(), printer, *painter);
  ^
../lib/pdfconverter.cc:291:14: error: expected ‘;’ before ‘wp’
  QWebPrinter wp(obj.page->mainFrame(), printer, *painter);
              ^
../lib/pdfconverter.cc:292:43: error: ‘wp’ was not declared in this scope
  obj.pageCount = obj.settings.pagesCount? wp.pageCount(): 0;
                                           ^
../lib/pdfconverter.cc:296:3: error: ‘outline’ was not declared in this scope
   outline->addWebPage(obj.page->mainFrame()->title(), wp, obj.page->mainFrame(),
   ^
../lib/pdfconverter.cc:297:26: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘localLinks’
        obj.settings, obj.localLinks, obj.anchors);
                          ^
../lib/pdfconverter.cc:297:42: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘anchors’
        obj.settings, obj.localLinks, obj.anchors);
                                          ^
../lib/pdfconverter.cc:299:3: error: ‘outline’ was not declared in this scope
   outline->addEmptyWebPage();
   ^
../lib/pdfconverter.cc: In member function ‘void wkhtmltopdf::PdfConverterPrivate::pagesLoaded(bool)’:
../lib/pdfconverter.cc:346:68: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘headerReserveHeight’
     printer->setPageMargins(settings.margin.left.first, objects[0].headerReserveHeight,
                                                                    ^
../lib/pdfconverter.cc:347:73: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘footerReserveHeight’
                                 settings.margin.right.first, objects[0].footerReserveHeight,
                                                                         ^
../lib/pdfconverter.cc: In member function ‘void wkhtmltopdf::PdfConverterPrivate::handleTocPage(wkhtmltopdf::PageObject&)’:
../lib/pdfconverter.cc:653:2: error: ‘QWebPrinter’ was not declared in this scope
  QWebPrinter wp(obj.page->mainFrame(), printer, *painter);
  ^
../lib/pdfconverter.cc:653:14: error: expected ‘;’ before ‘wp’
  QWebPrinter wp(obj.page->mainFrame(), printer, *painter);
              ^
../lib/pdfconverter.cc:654:36: error: ‘wp’ was not declared in this scope
  int pc = obj.settings.pagesCount? wp.pageCount(): 0;
                                    ^
../lib/pdfconverter.cc:660:15: error: ‘outline’ was not declared in this scope
  tocChanged = outline->replaceWebPage(obj.number, obj.settings.toc.captionText, wp, obj.page->mainFrame(), obj.settings, obj.localLinks, obj.anchors) || tocChanged;
               ^
../lib/pdfconverter.cc:660:126: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘localLinks’
  tocChanged = outline->replaceWebPage(obj.number, obj.settings.toc.captionText, wp, obj.page->mainFrame(), obj.settings, obj.localLinks, obj.anchors) || tocChanged;
                                                                                                                              ^
../lib/pdfconverter.cc:660:142: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘anchors’
  tocChanged = outline->replaceWebPage(obj.number, obj.settings.toc.captionText, wp, obj.page->mainFrame(), obj.settings, obj.localLinks, obj.anchors) || tocChanged;
                                                                                                                                              ^
../lib/pdfconverter.cc: In member function ‘void wkhtmltopdf::PdfConverterPrivate::measuringHeadersLoaded(bool)’:
../lib/pdfconverter.cc:726:17: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘measuringHeader’
         if (obj.measuringHeader) {
                 ^
../lib/pdfconverter.cc:728:17: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘headerReserveHeight’
             obj.headerReserveHeight = calculateHeaderHeight(obj, *obj.measuringHeader) + obj.settings.header.spacing;
                 ^
../lib/pdfconverter.cc:728:71: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘measuringHeader’
             obj.headerReserveHeight = calculateHeaderHeight(obj, *obj.measuringHeader) + obj.settings.header.spacing;
                                                                       ^
../lib/pdfconverter.cc:731:17: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘measuringFooter’
         if (obj.measuringFooter) {
                 ^
../lib/pdfconverter.cc:733:17: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘footerReserveHeight’
             obj.footerReserveHeight = calculateHeaderHeight(obj, *obj.measuringFooter) + obj.settings.header.spacing;
                 ^
../lib/pdfconverter.cc:733:71: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘measuringFooter’
             obj.footerReserveHeight = calculateHeaderHeight(obj, *obj.measuringFooter) + obj.settings.header.spacing;
                                                                       ^
../lib/pdfconverter.cc: In member function ‘void wkhtmltopdf::PdfConverterPrivate::spoolPage(size_t)’:
../lib/pdfconverter.cc:758:2: error: ‘webPrinter’ was not declared in this scope
  webPrinter->spoolPage(page+1);
  ^
../lib/pdfconverter.cc:764:13: error: ‘class QPainter’ has no member named ‘addTextField’
    painter->addTextField(
             ^
../lib/pdfconverter.cc:774:13: error: ‘class QPainter’ has no member named ‘addCheckBox’
    painter->addCheckBox(
             ^
../lib/pdfconverter.cc:784:12: error: ‘class QPainter’ has no member named ‘addAnchor’
   painter->addAnchor(r, i.key());
            ^
../lib/pdfconverter.cc:789:12: error: ‘class QPainter’ has no member named ‘addLink’
   painter->addLink(r, i->second);
            ^
../lib/pdfconverter.cc:794:12: error: ‘class QPainter’ has no member named ‘addHyperlink’
   painter->addHyperlink(r, QUrl(i->second));
            ^
../lib/pdfconverter.cc:796:71: error: ‘endPage’ was not declared in this scope
  endPage(objects[currentObject], pageHasHeaderFooter, page, pageNumber);
                                                                       ^
../lib/pdfconverter.cc: In member function ‘void wkhtmltopdf::PdfConverterPrivate::spoolTo(size_t)’:
../lib/pdfconverter.cc:803:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while (objectPage < page) {
                      ^
make[1]: *** [../../build/moc_pdfconverter_p.o] Error 1
make[1]: *** Waiting for unfinished jobs....
../lib/pdfconverter.cc: In member function ‘void wkhtmltopdf::PdfConverterPrivate::beginPrintObject(wkhtmltopdf::PageObject&)’:
../lib/pdfconverter.cc:836:2: error: ‘webPrinter’ was not declared in this scope
  webPrinter = new QWebPrinter(obj.page->mainFrame(), printer, *painter);
  ^
../lib/pdfconverter.cc:836:19: error: expected type-specifier before ‘QWebPrinter’
  webPrinter = new QWebPrinter(obj.page->mainFrame(), printer, *painter);
                   ^
../lib/pdfconverter.cc:836:19: error: expected ‘;’ before ‘QWebPrinter’
../lib/pdfconverter.cc:840:2: error: ‘outline’ was not declared in this scope
  outline->fillAnchors(obj.number, obj.anchors);
  ^
../lib/pdfconverter.cc:840:39: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘anchors’
  outline->fillAnchors(obj.number, obj.anchors);
                                       ^
../lib/pdfconverter.cc:843:51: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘anchors’
  for (QHash<QString, QWebElement>::iterator i=obj.anchors.begin();
                                                   ^
../lib/pdfconverter.cc:844:13: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘anchors’
    i != obj.anchors.end(); ++i)
             ^
../lib/pdfconverter.cc:847:61: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘localLinks’
  for (QVector< QPair<QWebElement,QString> >::iterator i=obj.localLinks.begin();
                                                             ^
../lib/pdfconverter.cc:848:13: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘localLinks’
    i != obj.localLinks.end(); ++i)
             ^
../lib/pdfconverter.cc:851:61: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘externalLinks’
  for (QVector< QPair<QWebElement,QString> >::iterator i=obj.externalLinks.begin();
                                                             ^
../lib/pdfconverter.cc:852:13: error: ‘class wkhtmltopdf::PageObject’ has no member named ‘externalLinks’
    i != obj.externalLinks.end(); ++i)
             ^
../lib/pdfconverter.cc: In member function ‘void wkhtmltopdf::PdfConverterPrivate::endPrintObject(wkhtmltopdf::PageObject&)’:
../lib/pdfconverter.cc:879:10: error: ‘webPrinter’ was not declared in this scope
  spoolTo(webPrinter->pageCount());
          ^
../lib/pdfconverter.cc:884:9: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
  delete webPrinter;
         ^
../lib/pdfconverter.cc: At global scope:
../lib/pdfconverter.cc:878:6: warning: unused parameter ‘obj’ [-Wunused-parameter]
 void PdfConverterPrivate::endPrintObject(PageObject & obj) {
      ^
make[1]: *** [../../build/pdfconverter.o] Error 1
make[1]: Leaving directory `/home/wildan/jobstuff/software/wkhtml/0.12/wkhtmltopdf/src/lib'
make: *** [sub-src-lib-make_default-ordered] Error 2

Coba ulangi lagi sesuai [7]: 

sudo apt-get build-dep libqt4-gui libqt4-network libqt4-webkit
sudo apt-get install openssl build-essential xorg git-core git-doc libssl-dev


git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt

cd wkhtmltopdf-qt
git branch checkout 4.8.2
export QTDIR=.
bin/syncqt
./configure -nomake tools,examples,demos,docs,translations -opensource -prefix ../wkqt
make -j3
make install
cd ..

git clone https://github.com/antialize/wkhtmltopdf.git
cd wkhtmltopdf
../wkqt/bin/qmake
make -j3

Alhamdulillah "how-to" diatas, yaitu [7], berhasil ..., tapi yang dihasilkan masih dynamically linked, 

wkhtml/0.12/wkhtmltopdf# file  /bin/wkhtmltopdf 
/bin/wkhtmltopdf: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x6c86563539d828e7692df5d856d26c9e82906dc0, stripped

Sekarang dicoba untuk membuat static versionya, baik untuk 32 bit ataupun 64 bit.

Setelah menjalankan perintah : 

wkhtml/0.12/wkhtmltopdf# ./scripts/static-build.sh linux-i386

Terjadi error berikut : 

.....
g++ -Wl,-rpath-link,/build/qts/lib -Wl,-O1 -Wl,-rpath,/build/qts/src/3rdparty/webkit/Source/lib -Wl,-rpath,/build/qt/lib -Wl,-rpath,/build/qt/lib -o tst_qwebhistoryinterface .obj/release-static/tst_qwebhistoryinterface.o    -L/build/qts/lib -L/usr/X11R6/lib -L/build/qts/lib -lQtWebKit -L../../WebCore/release -L../../JavaScriptCore/release -L/usr/X11R6/lib -lwebcore -ljscore -lQtTest -lQtGui -lXrender -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lm -ldl -lrt -lpthread -lXrender -lfontconfig -lfreetype -lXext -lX11 -lm
/usr/bin/ld: cannot find -lwebcore
collect2: ld returned 1 exit status
make[3]: *** [tst_qwebhistoryinterface] Error 1
make[3]: Leaving directory `/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/qwebhistoryinterface'
make[2]: *** [sub-qwebhistoryinterface-make_default] Error 2
make[2]: *** Waiting for unfinished jobs....
g++ -c -pipe -Wall -Wextra -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -O2 -I/usr/include/freetype2 -D_REENTRANT -DNDEBUG -DBUILDING_QT__=1 -DNDEBUG -DTESTS_SOURCE_DIR=\"/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/\" -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../../../../../../mkspecs/linux-g++ -I. -I../../../../../../../../include/QtCore -I../../../../../../../../include/QtNetwork -I../../../../../../../../include/QtGui -I../../../../../../../../include/QtTest -I../../../../../../../../include/QtWebKit -I../../../../../../../../include -I../../tests -I../../Api -I../../../../../Source -I../../../../../include -I../../../../include/QtWebKit -I../../../../include -I/usr/X11R6/include -I.moc/release-static -o .obj/release-static/qrc_tst_qgraphicswebview.o .rcc/release-static/qrc_tst_qgraphicswebview.cpp
g++ -c -pipe -Wall -Wextra -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -O2 -I/usr/include/freetype2 -D_REENTRANT -DNDEBUG -DBUILDING_QT__=1 -DNDEBUG -DTESTS_SOURCE_DIR=\"/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/\" -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../../../../../../mkspecs/linux-g++ -I. -I../../../../../../../../include/QtCore -I../../../../../../../../include/QtNetwork -I../../../../../../../../include/QtGui -I../../../../../../../../include/QtTest -I../../../../../../../../include/QtWebKit -I../../../../../../../../include -I../../tests -I../../Api -I../../../../../Source -I../../../../../include -I../../../../include/QtWebKit -I../../../../include -I/usr/X11R6/include -I.moc/release-static -o .obj/release-static/qrc_tst_qwebelement.o .rcc/release-static/qrc_tst_qwebelement.cpp
g++ -c -pipe -Wall -Wextra -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -O2 -I/usr/include/freetype2 -D_REENTRANT -DNDEBUG -DBUILDING_QT__=1 -DNDEBUG -DTESTS_SOURCE_DIR=\"/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/\" -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../../../../../../mkspecs/linux-g++ -I. -I../../../../../../../../include/QtCore -I../../../../../../../../include/QtNetwork -I../../../../../../../../include/QtGui -I../../../../../../../../include/QtTest -I../../../../../../../../include/QtWebKit -I../../../../../../../../include -I../../tests -I../../Api -I../../../../../Source -I../../../../../include -I../../../../include/QtWebKit -I../../../../include -I/usr/X11R6/include -I.moc/release-static -o .obj/release-static/qrc_tst_qwebpage.o .rcc/release-static/qrc_tst_qwebpage.cpp
g++ -c -pipe -Wall -Wextra -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -O2 -I/usr/include/freetype2 -D_REENTRANT -DNDEBUG -DBUILDING_QT__=1 -DNDEBUG -DTESTS_SOURCE_DIR=\"/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/\" -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../../../../../../mkspecs/linux-g++ -I. -I../../../../../../../../include/QtCore -I../../../../../../../../include/QtNetwork -I../../../../../../../../include/QtGui -I../../../../../../../../include/QtTest -I../../../../../../../../include/QtWebKit -I../../../../../../../../include -I../../tests -I../../Api -I../../../../../Source -I../../../../../include -I../../../../include/QtWebKit -I../../../../include -I/usr/X11R6/include -I.moc/release-static -o .obj/release-static/qrc_tst_qwebframe.o .rcc/release-static/qrc_tst_qwebframe.cpp
g++ -Wl,-rpath-link,/build/qts/lib -Wl,-O1 -Wl,-rpath,/build/qts/src/3rdparty/webkit/Source/lib -Wl,-rpath,/build/qt/lib -Wl,-rpath,/build/qt/lib -o tst_qgraphicswebview .obj/release-static/tst_qgraphicswebview.o .obj/release-static/qrc_tst_qgraphicswebview.o    -L/build/qts/lib -L/usr/X11R6/lib -L/build/qts/lib -lQtWebKit -L../../WebCore/release -L../../JavaScriptCore/release -L/usr/X11R6/lib -lwebcore -ljscore -lQtTest -lQtGui -lXrender -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lm -ldl -lrt -lpthread -lXrender -lfontconfig -lfreetype -lXext -lX11 -lm
/usr/bin/ld: cannot find -lwebcore
collect2: ld returned 1 exit status
make[3]: *** [tst_qgraphicswebview] Error 1
make[3]: Leaving directory `/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/qgraphicswebview'
make[2]: *** [sub-qgraphicswebview-make_default] Error 2
g++ -Wl,-rpath-link,/build/qts/lib -Wl,-O1 -Wl,-rpath,/build/qts/src/3rdparty/webkit/Source/lib -Wl,-rpath,/build/qt/lib -Wl,-rpath,/build/qt/lib -o tst_qwebelement .obj/release-static/tst_qwebelement.o .obj/release-static/qrc_tst_qwebelement.o    -L/build/qts/lib -L/usr/X11R6/lib -L/build/qts/lib -lQtWebKit -L../../WebCore/release -L../../JavaScriptCore/release -L/usr/X11R6/lib -lwebcore -ljscore -lQtTest -lQtGui -lXrender -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lm -ldl -lrt -lpthread -lXrender -lfontconfig -lfreetype -lXext -lX11 -lm
/usr/bin/ld: cannot find -lwebcore
collect2: ld returned 1 exit status
make[3]: *** [tst_qwebelement] Error 1
make[3]: Leaving directory `/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/qwebelement'
make[2]: *** [sub-qwebelement-make_default] Error 2
g++ -Wl,-rpath-link,/build/qts/lib -Wl,-O1 -Wl,-rpath,/build/qts/src/3rdparty/webkit/Source/lib -Wl,-rpath,/build/qt/lib -Wl,-rpath,/build/qt/lib -o tst_qwebpage .obj/release-static/tst_qwebpage.o .obj/release-static/qrc_tst_qwebpage.o    -L/build/qts/lib -L/usr/X11R6/lib -L/build/qts/lib -lQtWebKit -L../../WebCore/release -L../../JavaScriptCore/release -L/usr/X11R6/lib -lwebcore -ljscore -lQtTest -lQtGui -lXrender -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lm -ldl -lrt -lpthread -lXrender -lfontconfig -lfreetype -lXext -lX11 -lm
/usr/bin/ld: cannot find -lwebcore
collect2: ld returned 1 exit status
make[3]: *** [tst_qwebpage] Error 1
make[3]: Leaving directory `/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/qwebpage'
make[2]: *** [sub-qwebpage-make_default] Error 2
g++ -Wl,-rpath-link,/build/qts/lib -Wl,-O1 -Wl,-rpath,/build/qts/src/3rdparty/webkit/Source/lib -Wl,-rpath,/build/qt/lib -Wl,-rpath,/build/qt/lib -o tst_qwebframe .obj/release-static/tst_qwebframe.o .obj/release-static/qrc_tst_qwebframe.o    -L/build/qts/lib -L/usr/X11R6/lib -L/build/qts/lib -lQtWebKit -L../../WebCore/release -L../../JavaScriptCore/release -L/usr/X11R6/lib -lwebcore -ljscore -lQtTest -lQtGui -lXrender -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lm -ldl -lrt -lpthread -lXrender -lfontconfig -lfreetype -lXext -lX11 -lm
/usr/bin/ld: cannot find -lwebcore
collect2: ld returned 1 exit status
make[3]: *** [tst_qwebframe] Error 1
make[3]: Leaving directory `/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests/qwebframe'
make[2]: *** [sub-qwebframe-make_default] Error 2
make[2]: Leaving directory `/build/qts/src/3rdparty/webkit/Source/WebKit/qt/tests'
make[1]: *** [sub-WebKit-qt-tests-make_default-ordered] Error 2
make[1]: Leaving directory `/build/qts/src/3rdparty/webkit/Source'
make: *** [sub-webkit-make_default-ordered] Error 2


Referensi

  1. Issue 730: QPixmap: Cannot create a QPixmap when no GUI is being used, http://code.google.com/p/wkhtmltopdf/issues/detail?id=730
  2. Install wkhtmltopdf on ubuntu 12.04, http://blog.hemantthorat.com/install-wkhtmltopdf-on-ubuntu-12-04/
  3. Install wkhtmltopdf static binary on Ubuntu Server,http://blog.tcs.de/install-wkhtmltopdf-on-ubuntu-server/
  4. Compilation, https://code.google.com/p/wkhtmltopdf/wiki/compilation
  5. Fix build with cups 1.5 snapshots, https://qt.gitorious.org/qt/digia-qt/commit/6967f9e3fadfff8122809207dc7a99af444f699b?format=patch
  6. Compiling wkhtmltopdf, https://groups.google.com/forum/#!msg/wkhtmltopdf-dev/bo-YVKo75F0/JnlG5ugASywJ
  7. Complete compile instructions, https://groups.google.com/forum/#!searchin/wkhtmltopdf-dev/Compile$20static$20binary/wkhtmltopdf-dev/fJlfI2zTW3c/xF2NQnLIojsJ
  8. Building the Qt port on Linux, http://trac.webkit.org/wiki/BuildingQtOnLinux

Comments