我正在使用cmake来编译程序。我使用了QDomDocument,QDomElement等。 在cmake中,我添加了...
SET(QT_USE_QTXML True)
FIND_PACKAGE(Qt4 4.8 REQUIRED COMPONENTS QtCore QtGui QtNetwork QtXml)
INCLUDE(${QT_USE_FILE})
链接时...
TARGET_LINK_LIBRARIES(
${PROJECT_NAME}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${CODE_LIB_FILES}
我尝试了$ {QT_QTXML_LIBRARY}(只是我对xml的猜测),但是没有效果。我能够构建,但是当它开始链接cmake时出现错误
undefined reference to `QDomDocument::QDomDocument()'
undefined reference to `QDomDocument::documentElement()
undefined reference to `QDomElement::QDomElement(QDomElement const&)'
......
......
many lines like above