![]() Registered Member ![]()
|
Hi folks,
I want to use the QXmlSchema class to validate some xml files against a xml schema file in a kde cmake project. Currently I run into linker errors (undefined references to QXmlSchema) when I build it. On google I found I that I had to add ${QT_QTXML_LIBRARY} to target_link_libraries but this does not solve my problem. Anyone hast got an advice for me? Cheers Frank. |
![]() KDE Developer ![]()
|
The QXmlSchema class is part of the QtXmlPatterns library (not QtXml); thus, you need to link to it using the variable ${QT_QTXMLPATTERNS_LIBRARY}.
In general, the naming for the CMake variables for Qt4 libraries is quite simple: all of them follow the general pattern ${QT_libraryname_LIBRARY}, where libraryname is the uppercase name of the library. For example: QtCore -> ${QT_QTCORE_LIBRARY}, QtXml -> ${QT_QTXML_LIBRARY}, QtScriptTools -> ${QT_QTSCRIPTTOOLS_LIBRARY}, and so on. Similar scheme for the KDE4 libraries, using ${KDE4_libraryname_LIBRARY} for indicating the library itself and ${KDE4_libraryname_LIBRARIES} for the library and all the required libraries needed when using it (eg using kdeui you most probably will use kdecore as well). For example: kdeui -> ${KDE4_KDEUI_LIBRARY}, kio -> ${KDE4_KIO_LIBRARY}, and so no.
Pino Toscano
|
![]() Registered Member ![]()
|
Hi Pino,
thank you, it's working now. Frank |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]