<div class="gmail_extra">Hi<br><br><div class="gmail_quote">On Sat, Apr 28, 2012 at 06:56, Lindsay Mathieson <span dir="ltr"><<a href="mailto:lindsay.mathieson@gmail.com" target="_blank">lindsay.mathieson@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-family:'Bitstream Vera Sans';font-size:11.5pt;font-weight:400;font-style:normal">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Searching on google seems to indicate an issue with moc not being invoked. Have been banging my head aginst this for days now.</p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Trying to build a shared plugin for QtWebKit, which uses the Qt4 plugin systems but can't get past the following link errors:</p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">Linking CXX shared library lib/libkdewebkit-spellplugin.so</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">CMakeFiles/kdewebkit-spellplugin.dir/kspellplugin.o: In function `KWebKitSpellChecker':</span></p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">/data/dev/kdewebkit-spellplugin/kspellplugin.h:19: undefined reference to `vtable for KWebKitSpellChecker'</span></p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">CMakeFiles/kdewebkit-spellplugin.dir/kspellplugin.o: In function `TestQWebKitPlatformPlugin':</span></p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">/data/dev/kdewebkit-spellplugin/kspellplugin.h:47: undefined reference to `vtable for TestQWebKitPlatformPlugin'</span></p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">collect2: ld returned 1 exit status</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">make[2]: *** [lib/libkdewebkit-spellplugin.so] Error 1</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">make[1]: *** [CMakeFiles/kdewebkit-spellplugin.dir/all] Error 2</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">make: *** [all] Error 2</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">*** Failed ***</span></p></div></blockquote><div><br></div><div>Not really something to do with kdevelop, but yes moc does not seem to be run or the resulting file is not</div>
<div>included into the plugin.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-family:'Bitstream Vera Sans';font-size:11.5pt;font-weight:400;font-style:normal">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:11.5pt">My cmake file is pretty basic:</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<ul style="margin-top:0px;margin-bottom:0px;margin-right:0px"><li style="margin-top:12px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'monospace'">project(kdewebkit-spellplugin)</span></li>

<li style="font-family:'monospace'"><br></li>
<li style="font-family:'monospace'">find_package(KDE4 REQUIRED)</li>
<li style="font-family:'monospace'">FIND_PACKAGE(Qt4 REQUIRED)</li>
<li style="font-family:'monospace'"><br></li>
<li style="font-family:'monospace'">include (KDE4Defaults)</li>
<li style="font-family:'monospace'"><br></li>
<li style="font-family:'monospace'">include_directories(/data/dev/webkit-blackpaws-kde-qt-webkit/Source/WebKit/qt/Api)</li>
<li style="font-family:'monospace'">include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )</li>
<li style="font-family:'monospace'"><br></li>
<li style="font-family:'monospace'"><br></li>
<li style="font-family:'monospace'">ADD_LIBRARY(kdewebkit-spellplugin SHARED kspellplugin.cpp kspellplugin.h)</li></ul></div></blockquote><div><br></div><div>You should use MODULE here not SHARED, since a plugin is not a shared library and usually doesn't get a soversion set or the version-symlinks.</div>
<div><br></div><div>More importantly though, since you use the basic CMake commands instead of the KDE wrappers, you need to add the moc-step yourself. You should use QT4_WRAP_CPP to do that and include the generated files into your plugin. This also means you need to remove a #include "kspellplugin.moc" in your cpp file if it exists.</div>
<div><br></div><div>Andreas</div><div><br></div></div></div>