Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) undefined reference to 'QListData::detach_grow'

 

Link error.

 

 

 

 

 

Full error message

 

/MyFolder/main.cpp:5: error: undefined reference to 'QListData::detach_grow(int*, int)'

 

 

 

 

 

 

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 <QListData/qt4/QListData-qt4.h>

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

 

The following project file was used:

 

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

 

 

 

 

 

Solution

 

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

 

QT += xml

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict