Results 1 to 4 of 4

Thread: symbol lookup error when using plugins

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Location
    Poprad/Prague
    Posts
    33
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question symbol lookup error when using plugins

    Hello!

    I'm trying to make an application which should be extensible using (lower-level, as guys from Trolltech call it) plugins.

    I want to access the methods of my own classes in the plugin, which is a source of my problems. I can access methods of Qt classes in a plugin (if they are passed as a parameter), but I can not use methods of my class (although it is passed as a parameter, too).

    When I found out that sth is wrong with the plugin system, I tried to modify the Plug&Paint example (to make sure if I didn't mess up sth with plugins), but that didn't work neither.

    so here is what I have in a header file:
    Qt Code:
    1. class myClass : public QObject {
    2. Q_OBJECT
    3. public:
    4. int sayHello(int a);
    5. };
    To copy to clipboard, switch view to plain text mode 

    and the in a cpp file:
    Qt Code:
    1. #include "myClass.h"
    2.  
    3. int myClass::sayHello(int a){
    4. a += 30;
    5. return a;
    6. }
    To copy to clipboard, switch view to plain text mode 

    I'm using slightly modified interfaces.h:
    Qt Code:
    1. ...
    2. class FilterInterface
    3. {
    4. public:
    5. virtual ~FilterInterface() {}
    6.  
    7. virtual QStringList filters() const = 0;
    8. --> virtual QImage filterImage(const QString &filter, const QImage &image, myClass &cla, QWidget *parent) = 0;
    9. };
    10. ...
    To copy to clipboard, switch view to plain text mode 

    and in the plugin code (basictools.cpp):
    Qt Code:
    1. QImage BasicToolsPlugin::filterImage(const QString &filter, const QImage &image, myClass &cla, QWidget * /* parent */)
    2. { int b = 50;
    3. --> int a = cla.sayHello( b );
    4. QImage result = image.convertToFormat(QImage::Format_RGB32);
    To copy to clipboard, switch view to plain text mode 

    Everything compiles fine, but I get an error at runtime (when invoking a filter):
    Qt Code:
    1. symbol lookup error: /home/.../bin/plugins/libpnp_basictools_debug.so: undefined symbol: _ZN7myClass8sayHelloEi
    To copy to clipboard, switch view to plain text mode 

    I've looked up here on the forum, but I didn't find a topic about it, so could you please help me or just a post a link where sth like this is explained?

    Thanx.
    PS: I think it is the same problem as had a guy here, but nobody replied to him...:/
    PS2: Compiling on Slack 10.2 with gcc 3.3.6 and Qt 4.1.3

  2. The following user says thank you to macbeth for this useful post:

    darkadept (30th August 2007)

Similar Threads

  1. Qt4 Plugins How-to
    By Chaid in forum Qt Programming
    Replies: 4
    Last Post: 8th July 2006, 08:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.