Results 1 to 2 of 2

Thread: Nested Plugins

  1. #1
    Join Date
    Mar 2006
    Posts
    4
    Thanks
    1

    Default Nested Plugins

    I'd like to create a plugin that uses another plugin. All of my plugins work fine on their own but when I try to use one from another, I get the following link error:

    unresolved external symbol "public: static struct QMetaObject const FCSButton::staticMetaObject" (?staticMetaObject@FCSButton@@2UQMetaObject@@B)

    FCSButton is a custom button plugin that I'd like to use inside of a custom spinbox plugin. The button works fine when using it in a regular widget in a normal app.

    My guess is that the preprocessor definitions used to create a plugin are not compatible with using a plugin. It's telling the compiler to export the custom button when it should be importing it. But, I can't find the right combination of definitions to make it work.

    I'm on Windows using Visual Studio 6 with QT 4.1.0-rc1

    Thanks,
    Luis Rodriguez

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Nested Plugins

    http://www.qtcentre.org/forum/showthread.php?t=638

    In short:

    In one plugin you must use something like this:
    Qt Code:
    1. #ifdef CREATE_FIRST_PLUGIN
    2. # define FIRST_PLUGIN_EXPORT Q_DECL_EXPORT
    3. #else
    4. # define FIRST_PLUGIN_EXPORT Q_DECL_IMPORT
    5. #endif
    To copy to clipboard, switch view to plain text mode 
    while in second one:
    Qt Code:
    1. #ifdef CREATE_SECOND_PLUGIN
    2. # define SECOND_PLUGIN_EXPORT Q_DECL_EXPORT
    3. #else
    4. # define SECOND_PLUGIN_EXPORT Q_DECL_IMPORT
    5. #endif
    To copy to clipboard, switch view to plain text mode 
    The CREATE_FIRST_PLUGIN and CREATE_SECOND_PLUGIN macros should be defined using DEFINES variable in the .pro files. This way you will be exporting symbols only from the DLL you are currently building, while other symbols will be imported.

  3. The following user says thank you to jacek for this useful post:

    Luis Rodriguez (13th March 2006)

Similar Threads

  1. QtPlugins how to communicate between plugins?
    By BeS in forum Qt Programming
    Replies: 1
    Last Post: 17th December 2008, 11:59
  2. Container plugins
    By Benne Gesserit in forum Qt Tools
    Replies: 4
    Last Post: 20th November 2008, 23:43
  3. Qt Plugins Error
    By nathanpackard in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2007, 23:19
  4. Nightmares with plugins
    By KShots in forum Qt Programming
    Replies: 6
    Last Post: 8th February 2007, 16:46
  5. Qt plugins - how to do a libtool-style autoload
    By KShots in forum Qt Programming
    Replies: 2
    Last Post: 7th February 2007, 12:40

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.