使用Qt 4.8.2。
当在cmake项目中使用QtWebkit模块时,它似乎与QtXmlPatterns库无关地链接。违规行为/usr/share/cmake-2.8/Modules/UseQt4.cmake:70
,内容为:
SET(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
但是,webkit库似乎不依赖于xmlpatterns库:
objdump -p /usr/lib/i386-linux-gnu/libQtWebKit.so | grep NEEDED
NEEDED libsqlite3.so.0
NEEDED libXrender.so.1
NEEDED libgstapp-0.10.so.0
NEEDED libgstinterfaces-0.10.so.0
NEEDED libgstpbutils-0.10.so.0
NEEDED libgstvideo-0.10.so.0
NEEDED libgstbase-0.10.so.0
NEEDED libgstreamer-0.10.so.0
NEEDED libgobject-2.0.so.0
NEEDED libglib-2.0.so.0
NEEDED libQtGui.so.4
NEEDED libQtNetwork.so.4
NEEDED libQtCore.so.4
NEEDED libpthread.so.0
NEEDED libX11.so.6
NEEDED libstdc++.so.6
NEEDED libm.so.6
NEEDED libgcc_s.so.1
NEEDED libc.so.6
(事实上,你应该注意到它取决于QtNetwork库,它在UseQt4.cmake:70中没有列出。)这导致我的应用程序有一个无用的链接到QtXmlPatterns。这是UseQt4.cmake中的错误,还是我错过了什么?