[vtkusers] libQVTK.so: undefined reference

David Gobbi david.gobbi at gmail.com
Wed Nov 17 13:25:09 EST 2010


Hi Agupta,

Not sure why CMake isn't catching it as a dependency of QVTK, but you
can try adding this before your link line:

SET(QT_LIBRARIES ${QT_LIBRARIES} QtXmlPatterns)

This is not supposed to be necessary because CMake should take care
of this for you.  If you look in your VTK build directory, there should be a
file called VTKLibraryDepends.cmake, and it should list QtXmlPatterns
as part of the QVTK_LIB_DEPENDS line.  Can you check to see if it is
there?

  David


On Wed, Nov 17, 2010 at 10:23 AM, agupta <adityargupta at gmail.com> wrote:
>
> Hello all,
>
> I am using VTK 5.6 on a CentOS linux 64 bit machine. I am developing a gui
> using C++, VTK and QT (Qt 4.6.2). When I run make, I do not receive any
> compilation errors but I receive the following linking errors:
>
>  Linking CXX executable bin/KrabbeQtITK
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractUriResolver::metaObject() const'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlQuery::bindVariable(QString const&, QXmlItem const&)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `typeinfo for QAbstractMessageHandler'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlQuery::setMessageHandler(QAbstractMessageHandler*)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QSourceLocation::line() const'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractMessageHandler::qt_metacast(char const*)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractMessageHandler::QAbstractMessageHandler(QObject*)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractMessageHandler::qt_metacall(QMetaObject::Call, int,
> void**)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractUriResolver::qt_metacast(char const*)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlQuery::evaluateTo(QIODevice*) const'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractMessageHandler::~QAbstractMessageHandler()'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlItem::QXmlItem(QVariant const&)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `typeinfo for QAbstractUriResolver'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlQuery::setUriResolver(QAbstractUriResolver const*)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlQuery::setQuery(QIODevice*, QUrl const&)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractMessageHandler::metaObject() const'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlQuery::~QXmlQuery()'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlQuery::QXmlQuery(QXmlQuery::QueryLanguage, QXmlNamePool
> const&)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractUriResolver::~QAbstractUriResolver()'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlNamePool::~QXmlNamePool()'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlItem::~QXmlItem()'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QSourceLocation::uri() const'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlQuery::setFocus(QIODevice*)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QXmlNamePool::QXmlNamePool()'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractUriResolver::QAbstractUriResolver(QObject*)'
> /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6/libQVTK.so: undefined
> reference to `QAbstractUriResolver::qt_metacall(QMetaObject::Call, int,
> void**)'
> collect2: ld returned 1 exit status
> make[2]: *** [bin/KrabbeQtITK] Error 1
> make[1]: *** [CMakeFiles/KrabbeQtITK.dir/all] Error 2
> make: *** [all] Error 2
>
> ***********************************************************************************
> In my code #include "QVTKWidget.h" calls this library and results in the
> linking errors. In my CMakelists file, I include the following libraries:
> TARGET_LINK_LIBRARIES(KrabbeQtITK QVTK ${ITK_LIBRARIES} ${VTK_LIBRARIES}
> ${QT_LIBRARIES} ${QT_QTDBUS_LIBRARY})
>
> I'm using CMake version 3.8. Any hints on how I can fix this issue?
>
> Thanks.
>
> Regards,
> agupta



More information about the vtkusers mailing list