Hi all,<br>I managed to get my sources to build, link/install, and load a single plugin. But now, when I tried to add a second plugin in the same way as the first, it doesn&#39;t work anymore. I think my problem is related to Q_EXPORT_PLUGIN2?: &quot;There should be exactly one occurrence of this macro in the source code 
for a Qt plugin, and it should be used where the implementation is 
written rather than in a header file.&quot; What defines &quot;the source code for a Qt plugin&quot;? I assumed it would be one .cpp file, but, that doesn&#39;t (experimentally) seem to be the case...?<br><br>The steps I took to get where I&#39;m at:<br>
1) code in svn works<br>2) copy symbolsuggesterplugin.* to companyinfoplugin.*<br>3) modify companyinfoplugin.* to inherent from plugininterfaces.h&#39;s KeysInterface as opposed to SymbolSuggesterInterface [I can&#39;t seem to do multiple inheritance because I needed to put a Q_OBJECT in each plugininterfaces.h&#39;s virtual class definition so that plugins can work with signals/slots... but then inheriting from two interface definitions means inhering from two different QObjects, which Qt complains about. Any suggestions for correct/better ways to keep signals/slots working in plugins?]<br>
4) add companyinfoplugin.* to CMake&#39;s set(SRCS) and set(MOC_headers_to_build) --&gt; that works; the 2nd plugin sources at least compile w/out error<br>5) add the line ADD_LIBRARY(companyinfoplugin SHARED ${backend_SRCs} ${backend_MOC_SRCs} ) to cmake --&gt; this is where things break<br>
<br>5a) error with the Q_EXPORT_PLUGIN2 at the end of both symbolsuggesterplugin.cpp (where it worked before) and at the end of companyinfoplugin.cpp:<br>CMakeFiles/quotebackend.dir/companyinfoplugin.cpp.o: In function `qt_plugin_query_verification_data&#39;:                                                                                                                                                                                 <br>
/home/brian/test/alkimia/alkquotes/backend/companyinfoplugin.cpp:234: multiple definition of `qt_plugin_query_verification_data&#39;<br>CMakeFiles/quotebackend.dir/symbolsuggesterplugin.cpp.o:/home/brian/test/alkimia/alkquotes/backend/symbolsuggesterplugin.cpp:241: first defined here<br>
CMakeFiles/quotebackend.dir/companyinfoplugin.cpp.o: In function `qt_plugin_instance&#39;:<br>/home/brian/test/alkimia/alkquotes/backend/companyinfoplugin.cpp:234: multiple definition of `qt_plugin_instance&#39;<br>CMakeFiles/quotebackend.dir/symbolsuggesterplugin.cpp.o:/home/brian/test/alkimia/alkquotes/backend/symbolsuggesterplugin.cpp:241: first defined here<br>
CMakeFiles/quotebackend.dir/moc_companyinfoplugin.cxx.o:(.rodata._ZTV17CompanyInfoPlugin[vtable for CompanyInfoPlugin]+0x80): undefined reference to `CompanyInfoPlugin::humanReadableKeys(QStringList const&amp;)&#39;<br>collect2: ld returned 1 exit status<br>
make[2]: *** [backend/quotebackend] Error 1<br>make[1]: *** [backend/CMakeFiles/quotebackend.dir/all] Error 2<br>make[1]: *** Waiting for unfinished jobs....<br><br>5b) the error with the Q_EXPORT_PLUGIN2 line commented out in only companyinfoplugin:<br>
Waaaaay more lines than my console can handle, but essentially, i get undefined references to (seemingly) every qt function/object/whatever like so:<br><br>CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o: In function `CompanyInfoPlugin::keysDownloaded(QString const&amp;, QString const&amp;, QStringList const&amp;, QStringList const&amp;)&#39;:<br>
/home/brian/test/alkimia/alkquotes/build/backend/moc_companyinfoplugin.cxx:97: undefined reference to `QMetaObject::activate(QObject*, QMetaObject const*, int, void**)&#39;<br>CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o: In function `QList&lt;QString&gt;::detach_helper()&#39;:<br>
/usr/include/QtCore/qlist.h:604: undefined reference to `QListData::detach3()&#39;<br>CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o: In function `~QString&#39;:<br>/usr/include/QtCore/qstring.h:869: undefined reference to `QString::free(QString::Data*)&#39;<br>
CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o: In function `QList&lt;QString&gt;::free(QListData::Data*)&#39;:<br>/usr/include/QtCore/qlist.h:649: undefined reference to `qFree(void*)&#39;<br>CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o:(.data.rel.ro._ZTV17CompanyInfoPlugin[vtable for CompanyInfoPlugin]+0x38): undefined reference to `QObject::event(QEvent*)&#39;<br>
CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o:(.data.rel.ro._ZTV17CompanyInfoPlugin[vtable for CompanyInfoPlugin]+0x40): undefined reference to `QObject::eventFilter(QObject*, QEvent*)&#39;<br>CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o:(.data.rel.ro._ZTV17CompanyInfoPlugin[vtable for CompanyInfoPlugin]+0x48): undefined reference to `QObject::timerEvent(QTimerEvent*)&#39;<br>
CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o:(.data.rel.ro._ZTV17CompanyInfoPlugin[vtable for CompanyInfoPlugin]+0x50): undefined reference to `QObject::childEvent(QChildEvent*)&#39;<br>CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o:(.data.rel.ro._ZTV17CompanyInfoPlugin[vtable for CompanyInfoPlugin]+0x58): undefined reference to `QObject::customEvent(QEvent*)&#39;<br>
CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o:(.data.rel.ro._ZTV17CompanyInfoPlugin[vtable for CompanyInfoPlugin]+0x60): undefined reference to `QObject::connectNotify(char const*)&#39;<br>CMakeFiles/companyinfoplugin.dir/moc_companyinfoplugin.cxx.o:(.data.rel.ro._ZTV17CompanyInfoPlugin[vtable for CompanyInfoPlugin]+0x68): undefined reference to `QObject::disconnectNotify(char const*)&#39;<br>
<br>Anybody got any ideas? I committed the files to svn for reference and left the code at step 4 so that it compiles without error.<br>Thanks!<br>