[webkit-qt] Static Plugin Link error

Lindsay Mathieson lindsay.mathieson at gmail.com
Sat Apr 16 15:41:36 PDT 2011


For test purposes I'm trying to create a static plugin in
QtTestBrowser. I got as far as successfully exporting/importing a
QWebKitPlatformPlugin implementation and having it recognised, but
when I try to implement my QWebSpellChecker interface I get the
following errors.

g++ -Wl,-z,origin '-Wl,-rpath,$ORIGIN/../lib' -Wl,-O1 -o
../bin/QtTestBrowser obj/release/locationedit.o
obj/release/launcherwindow.o obj/release/main.o
obj/release/mainwindow.o obj/release/urlloader.o obj/release/utils.o
obj/release/webpage.o obj/release/webview.o obj/release/fpstimer.o
obj/release/testqwebspellchecker.o obj/release/moc_locationedit.o
obj/release/moc_launcherwindow.o obj/release/moc_mainwindow.o
obj/release/moc_urlloader.o obj/release/moc_webinspector.o
obj/release/moc_webpage.o obj/release/moc_webview.o
obj/release/moc_fpstimer.o obj/release/moc_testqwebspellchecker.o
obj/release/qrc_QtTestBrowser.o
-L/home/lindsay/projects/webkit/WebKitBuild/Release/lib -L/usr/lib
-L/usr/X11R6/lib -lQtWebKit -L/usr/lib/i386-linux-gnu -lfontconfig
-lQtXml -lQtOpenGL -lQtGui -lQtNetwork -lQtCore -lQtUiTools -lGLU -lGL
-lpthread
obj/release/testqwebspellchecker.o: In function
`TestQWebSpellChecker::~TestQWebSpellChecker()':
testqwebspellchecker.cpp:(.text._ZN20TestQWebSpellCheckerD2Ev[_ZN20TestQWebSpellCheckerD5Ev]+0xb):
undefined reference to `vtable for QWebSpellChecker'
obj/release/testqwebspellchecker.o: In function
`TestQWebSpellChecker::~TestQWebSpellChecker()':
testqwebspellchecker.cpp:(.text._ZN20TestQWebSpellCheckerD0Ev[_ZN20TestQWebSpellCheckerD5Ev]+0xc):
undefined reference to `vtable for QWebSpellChecker'
obj/release/moc_testqwebspellchecker.o: In function
`TestQWebSpellChecker::qt_metacall(QMetaObject::Call, int, void**)':
moc_testqwebspellchecker.cpp:(.text+0xf8): undefined reference to
`QWebSpellChecker::qt_metacall(QMetaObject::Call, int, void**)'
obj/release/moc_testqwebspellchecker.o: In function
`TestQWebSpellChecker::qt_metacast(char const*)':
moc_testqwebspellchecker.cpp:(.text+0x155): undefined reference to
`QWebSpellChecker::qt_metacast(char const*)'
obj/release/moc_testqwebspellchecker.o:(.rodata+0x0): undefined
reference to `QWebSpellChecker::staticMetaObject'
obj/release/moc_testqwebspellchecker.o:(.rodata._ZTI20TestQWebSpellChecker[typeinfo
for TestQWebSpellChecker]+0x8): undefined reference to `typeinfo for
QWebSpellChecker'
collect2: ld returned 1 exit status
make[1]: *** [../bin/QtTestBrowser] Error 1
make[1]: Leaving directory
`/home/lindsay/projects/webkit/WebKitBuild/Release/QtTestBrowser'
make: *** [sub-QtTestBrowser-QtTestBrowser-pro-make_default-ordered] Error 2

--------------------------------------------------------

As another test I have tried implementing an existing interface such
as QWebTouchModifier and I get a similar error. Any suggestions?

Code below:

qwebkitplatformplugin.h:
----------------------------------
class QWebSpellChecker : public QObject {
    Q_OBJECT

public:
    virtual ~QWebSpellChecker() {}
    virtual bool isInlineSpellCheckingEnabled() const = 0;


};


QtTestBrowser Implementation
---------------------------------------------
class TestQWebSpellChecker :  public QWebSpellChecker
{
    Q_OBJECT

public:
    bool isInlineSpellCheckingEnabled() const;
};


-- 
Lindsay


More information about the webkit-qt mailing list