Trouble Building Qt4 Plugin - moc not being invoked?
Lindsay Mathieson
lindsay.mathieson at gmail.com
Sat Apr 28 05:56:34 BST 2012
Searching on google seems to indicate an issue with moc not being invoked.
Have been banging my head aginst this for days now.
Trying to build a shared plugin for QtWebKit, which uses the Qt4 plugin
systems but can't get past the following link errors:
Linking CXX shared library lib/libkdewebkit-spellplugin.so
CMakeFiles/kdewebkit-spellplugin.dir/kspellplugin.o: In function
`KWebKitSpellChecker':
/data/dev/kdewebkit-spellplugin/kspellplugin.h:19: undefined reference to
`vtable for KWebKitSpellChecker'
CMakeFiles/kdewebkit-spellplugin.dir/kspellplugin.o: In function
`TestQWebKitPlatformPlugin':
/data/dev/kdewebkit-spellplugin/kspellplugin.h:47: undefined reference to
`vtable for TestQWebKitPlatformPlugin'
collect2: ld returned 1 exit status
make[2]: *** [lib/libkdewebkit-spellplugin.so] Error 1
make[1]: *** [CMakeFiles/kdewebkit-spellplugin.dir/all] Error 2
make: *** [all] Error 2
*** Failed ***
My cmake file is pretty basic:
project(kdewebkit-spellplugin)
find_package(KDE4 REQUIRED)
FIND_PACKAGE(Qt4 REQUIRED)
include (KDE4Defaults)
include_directories(/data/dev/webkit-blackpaws-kde-qt-
webkit/Source/WebKit/qt/Api)
include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
ADD_LIBRARY(kdewebkit-spellplugin SHARED kspellplugin.cpp kspellplugin.h)
target_link_libraries(kdewebkit-spellplugin ${KDE4_KDEUI_LIBS}
${QT_LIBRARIES})
Part of the header if relevant:
class KWebKitSpellChecker : public QWebSpellChecker {
Q_OBJECT
public:
Sonnet::Speller *m_speller;
KWebKitSpellChecker()
{
m_speller = new Sonnet::Speller();
}
~KWebKitSpellChecker()
{
delete m_speller;
}
--
Lindsay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20120428/154c8cc1/attachment.html>
More information about the KDevelop
mailing list