Results 1 to 3 of 3

Thread: Common classes between main application and plugins

  1. #1
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Common classes between main application and plugins

    Hello everyone!

    Well, I'm trying to make an application that loads different plugins to give it different functionalities. My problem arises when I try to share a class between my main application and its plugins. I mean, in the main application I have a header file where I define a class and another file for its implementation. What I want to do is to give the plugin access to this very same class, so what I tried was to simply include the headers in my plugin code (the include directory was already set in order to be able to include the "interfaces.h" where the plugin interface is defined). It gives no problems, and I can use objects from this class and call the functions that it inherits from other Qt classes, but as soon as I try to call a function member from the class it gives this error: symbol lookup error: /home/santiago/Qt/StraK/plugins/libeighttracksplugin.so: undefined symbol: _ZN11borderImage8setAlphaEi. I guess this has to do with a linking problem, but I can't figure out how to solve it.

    Thanks in advance for your help!

  2. #2
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Common classes between main application and plugins

    Can u give us some code, and mark where the error occurs?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Common classes between main application and plugins

    The proper way to do it is to export all shared classes and functions into a shared library that is linked by both the main application and the plugins.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 25th February 2012, 22:25
  2. Replies: 0
    Last Post: 15th April 2011, 11:03
  3. qmake: dependency of application on common shared library
    By PeterWurmsdobler in forum Qt Programming
    Replies: 5
    Last Post: 27th March 2009, 16:13
  4. Qt4: How to get the Common Application Data folder path?
    By Ankitha Varsha in forum Qt Programming
    Replies: 10
    Last Post: 21st October 2008, 12:14
  5. Plugins that use *.ui based classes
    By blackliteon in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2006, 09:33

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.