Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) undefined reference to 'Poppler::Document::load'

 

Link error.

 

 

 

 

 

Full error message

 

/MyFolder/main.cpp:5: error: undefined reference to 'Poppler::Document::load(QString const&, QByteArray const&, QByteArray const&)'

 

 

 

 

 

 

Cause

 

IDE: Qt Creator 2.0.0

Project type: Qt4 Console Application

Selected required modules: QtCore

Compiler: G++ 4.4.1

 

The following source code was used:

 

#include <poppler/qt4/poppler-qt4.h>

int main()
{
  const Poppler::Document * const doc
    = Poppler::Document::load("test.pdf");
}

 

The following project file was used:

 

#------------------------------------------------- # # Project created by QtCreator 2010-09-18T12:40:50 # #------------------------------------------------- QT += core gui TARGET = CppGraphExample4 TEMPLATE = app SOURCES += main.cpp\ dialogmain.cpp HEADERS += dialogmain.h FORMS += dialogmain.ui

 

 

 

 

 

Solution

 

You need to link against the Poppler library. Add the following line to your project file:

 

LIBS += -L/usr/local/lib -lpoppler-qt4

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict